idtokenvalidator

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IDTokenValidator

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

IDTokenValidator is used to validate ID tokens retrieved from Auth0.

func New

func New(
	ctx context.Context,
	domain string,
	clientID string,
	clientSecret string,
	idTokenSigningAlg string,
	opts ...Option,
) (*IDTokenValidator, error)

New creates and returns a new IDTokenValidator.

func (*IDTokenValidator) Validate

func (i *IDTokenValidator) Validate(idToken string, optional ValidationOptions) error

Validate validates the provided ID token against the values provided during the IDTokenValidator creation.

type Option

type Option func(*IDTokenValidator)

Option is used for passing options to an `IDTokenValidator`.

func WithClockTolerance

func WithClockTolerance(clockTolerance time.Duration) Option

WithClockTolerance configures the allowed clock tolerance when validating time based claims.

func WithHTTPClient

func WithHTTPClient(client *http.Client) Option

WithHTTPClient configures the HTTP Client used by the JWKS fetcher.

type ValidationOptions

type ValidationOptions struct {
	MaxAge       time.Duration
	Nonce        string
	Organization string
}

ValidationOptions allows validating optional claims that might not always be in the ID token.

Jump to

Keyboard shortcuts

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