provider

package
v0.0.0-...-39a3188 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFreePort

func GetFreePort() (int, error)

A function to determine any free ports to use taken from https://stackoverflow.com/a/48283226

Types

type OAuth2Token

type OAuth2Token struct {
	AccessToken  string    `json:"access_token"`
	TokenType    string    `json:"token_type,omitempty"`
	RefreshToken string    `json:"refresh_token,omitempty"`
	Expiry       time.Time `json:"expiry,omitempty"`
	IDToken      string    `json:"id_token,omitempty"`
}

type ProviderConfig

type ProviderConfig struct {
	ClientID               string
	ClientSecret           string
	ProviderURL            string
	PKCE                   bool
	Nonce                  bool
	AgentCommand           []string
	ProviderReturnHTML     string
	AgentUseDefaultBrowser bool
}

func (ProviderConfig) Authenticate

func (p ProviderConfig) Authenticate(t *OAuth2Token) error

type Result

type Result struct {
	JWT    string
	Token  *oidc.IDToken
	Claims *TokenClaims
}

type TokenClaims

type TokenClaims struct {
	Issuer        string   `json:"iss"`
	Audience      string   `json:"aud"`
	Subject       string   `json:"sub"`
	Picture       string   `json:"picture"`
	Email         string   `json:"email"`
	EmailVerified bool     `json:"email_verified"`
	Groups        []string `json:"groups"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL