oidc

package
v2.28.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertTokenToRawIDToken

func ConvertTokenToRawIDToken(token *oauth2.Token) (string, error)

func GenerateChallenge

func GenerateChallenge() (string, error)

func IsCannotDecodeToken

func IsCannotDecodeToken(err error) bool

IsCannotDecodeToken asserts cannotDecodeTokenError.

func IsCannotRenewToken

func IsCannotRenewToken(err error) bool

IsCannotRenewToken asserts cannotRenewTokenError.

func IsInvalidChallenge

func IsInvalidChallenge(err error) bool

IsInvalidChallenge asserts invalidChallengeError.

Types

type Authenticator

type Authenticator struct {
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, c Config) (*Authenticator, error)

func (*Authenticator) GetAuthURL

func (a *Authenticator) GetAuthURL(connectorID string) string

func (*Authenticator) HandleIssuerResponse

func (a *Authenticator) HandleIssuerResponse(ctx context.Context, challenge string, code string) (UserInfo, error)

func (*Authenticator) RenewToken

func (a *Authenticator) RenewToken(ctx context.Context, refreshToken string) (idToken string, rToken string, err error)

type Claims

type Claims struct {
	Email    string   `json:"email"`
	Verified bool     `json:"email_verified"`
	Groups   []string `json:"groups"`
}

type Config

type Config struct {
	ClientID     string
	ClientSecret string
	Issuer       string
	RedirectURL  string
	AuthScopes   []string
}

type UserInfo

type UserInfo struct {
	Email         string
	EmailVerified bool
	IDToken       string
	RefreshToken  string
	IssuerURL     string
	Username      string
	Groups        []string
	ClientID      string
	ClientSecret  string
}

Jump to

Keyboard shortcuts

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