profile

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithAssertionDuration

func WithAssertionDuration(d time.Duration) func(source *jwtProfileTokenSource)

WithAssertionDuration sets the duration for the JWT assertion expiration. If not set, defaults to 1 hour.

func WithHTTPClient

func WithHTTPClient(client *http.Client) func(source *jwtProfileTokenSource)

func WithStaticTokenEndpoint

func WithStaticTokenEndpoint(issuer, tokenEndpoint string) func(source *jwtProfileTokenSource)

Types

type TokenSource

type TokenSource interface {
	oauth2.TokenSource
	TokenCtx(context.Context) (*oauth2.Token, error)
}

func NewJWTProfileTokenSource

func NewJWTProfileTokenSource(ctx context.Context, issuer, clientID, keyID string, key []byte, scopes []string, options ...func(source *jwtProfileTokenSource)) (TokenSource, error)

NewJWTProfileTokenSource returns an implementation of oauth2.TokenSource It will request a token using the OAuth2 JWT Profile Grant, therefore sending an `assertion` by singing a JWT with the provided private key.

The passed context is only used for the call to the Discover endpoint.

Jump to

Keyboard shortcuts

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