oidc

package
v0.0.0-...-2cf57f6 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthResult

type AuthResult struct {
	Token   *oauth2.Token
	IDToken *oidc.IDToken
	Profile map[string]interface{}
}

AuthResult represents results of OpenID Connect authentication flow

type Authenticator

type Authenticator struct {
	Provider *oidc.Provider
	Config   oauth2.Config
}

Authenticator is a helper to sign in with OpenID Connect

func NewAuthenticator

func NewAuthenticator(ctx context.Context, clientID, clientSecret, redirectURL, providerURL string, scopes []string) (*Authenticator, error)

NewAuthenticator initializes an Authenticator

func (*Authenticator) Callback

func (author *Authenticator) Callback(ctx context.Context, expectedState, actualState, code string) (*AuthResult, error)

Callback handles callback requests from IdP

func (*Authenticator) Login

func (author *Authenticator) Login(ctx context.Context) (redirectURL, state string, err error)

Login generates state and redirect url to IdP

Jump to

Keyboard shortcuts

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