Documentation ¶
Index ¶
- func ExchangeToken(ctx context.Context, te TokenExchanger, SubjectToken string, ...) (*oidc.TokenExchangeResponse, error)
- func WithHTTPClient(client *http.Client) func(*OAuthTokenExchange)
- func WithStaticTokenEndpoint(issuer, tokenEndpoint string) func(*OAuthTokenExchange)
- type OAuthTokenExchange
- type TokenExchanger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExchangeToken ¶
func ExchangeToken( ctx context.Context, te TokenExchanger, SubjectToken string, SubjectTokenType oidc.TokenType, ActorToken string, ActorTokenType oidc.TokenType, Resource []string, Audience []string, Scopes []string, RequestedTokenType oidc.TokenType, ) (*oidc.TokenExchangeResponse, error)
ExchangeToken sends a token exchange request (rfc 8693) to te's token endpoint. SubjectToken and SubjectTokenType are required parameters.
func WithHTTPClient ¶
func WithHTTPClient(client *http.Client) func(*OAuthTokenExchange)
func WithStaticTokenEndpoint ¶
func WithStaticTokenEndpoint(issuer, tokenEndpoint string) func(*OAuthTokenExchange)
Types ¶
type OAuthTokenExchange ¶
type OAuthTokenExchange struct {
// contains filtered or unexported fields
}
func (*OAuthTokenExchange) AuthFn ¶
func (te *OAuthTokenExchange) AuthFn() (any, error)
func (*OAuthTokenExchange) HttpClient ¶
func (te *OAuthTokenExchange) HttpClient() *http.Client
func (*OAuthTokenExchange) TokenEndpoint ¶
func (te *OAuthTokenExchange) TokenEndpoint() string
type TokenExchanger ¶
type TokenExchanger interface { TokenEndpoint() string HttpClient() *http.Client AuthFn() (any, error) }
func NewTokenExchanger ¶
func NewTokenExchanger(ctx context.Context, issuer string, options ...func(source *OAuthTokenExchange)) (TokenExchanger, error)
func NewTokenExchangerClientCredentials ¶
func NewTokenExchangerClientCredentials(ctx context.Context, issuer, clientID, clientSecret string, options ...func(source *OAuthTokenExchange)) (TokenExchanger, error)
Click to show internal directories.
Click to hide internal directories.