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: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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