oidc

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2020 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OAuth2Config

type OAuth2Config struct {
	ClientID, ClientSecret string
	Endpoint               oauth2.Endpoint
	RedirectURL            string
}

OAuth2Config is an implementation of the OAuth2Config interface

func (*OAuth2Config) ExchangeCodeForToken

func (o *OAuth2Config) ExchangeCodeForToken(ctx context.Context, code string) (*oauth2.Token, error)

ExchangeCodeForToken takes the final step in the OAuth flow and fetches an ID token

func (*OAuth2Config) ExchangeRefreshForToken

func (o *OAuth2Config) ExchangeRefreshForToken(ctx context.Context, token *oauth2.Token) (*oauth2.Token, error)

ExchangeRefreshForToken exchanges a refresh token for a standard token, and thus can be used to extend sessions

func (*OAuth2Config) GenerateAuthCodeURL

func (o *OAuth2Config) GenerateAuthCodeURL(state string, scopes []string, options []oauth2.AuthCodeOption) string

GenerateAuthCodeURL generates the URL to visit to authenticate the user

func (*OAuth2Config) GetTokenSource

func (o *OAuth2Config) GetTokenSource(ctx context.Context, token *oauth2.Token) oauth2.TokenSource

GetTokenSource returns a token source to get a token from, based on the provided token

type Verifier

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

Verifier is an implementation of the Verifier interface

func NewOIDCVerifier

func NewOIDCVerifier(v *oidc.IDTokenVerifier) Verifier

NewOIDCVerifier constructs a new oidc.Verifier with the given IDTokenVerifier

func (*Verifier) Verify

func (o *Verifier) Verify(ctx context.Context, rawIDToken string) error

Verify checks that a given ID token is valid

Jump to

Keyboard shortcuts

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