profile

package
v3.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: Apache-2.0 Imports: 7 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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)

NewJWTProfileSource 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.

func NewJWTProfileTokenSourceFromKeyFile

func NewJWTProfileTokenSourceFromKeyFile(ctx context.Context, issuer, jsonFile string, scopes []string, options ...func(source *jwtProfileTokenSource)) (TokenSource, error)

NewJWTProfileTokenSourceFromKeyFile returns an implementation of 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 from jsonFile.

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

func NewJWTProfileTokenSourceFromKeyFileData

func NewJWTProfileTokenSourceFromKeyFileData(ctx context.Context, issuer string, jsonData []byte, scopes []string, options ...func(source *jwtProfileTokenSource)) (TokenSource, error)

NewJWTProfileTokenSourceFromKeyFileData 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 in jsonData.

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