Documentation ¶
Overview ¶
Package oidc contains utilities related to OIDC tokens.
Package oidc implements support for fetching OIDC tokens
Index ¶
Constants ¶
const (
// PKCES256 is the SHA256 option required by the PKCE RFC
PKCES256 = "S256"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IDTokenSource ¶
type IDTokenSource interface { // IDToken returns an ID token or an error. IDToken(context.Context) (*IDToken, error) }
IDTokenSource provides `IDTokens`.
func InteractiveIDTokenSource ¶
func InteractiveIDTokenSource(cfg oauth2.Config, oidp *coreoidc.Provider, extraAuthCodeOpts []oauth2.AuthCodeOption, allowBrowser bool) IDTokenSource
InteractiveIDTokenSource returns an `IDTokenSource` which performs an interactive Oauth token flow in order to retrieve an `IDToken`.
func StaticIDTokenSource ¶
func StaticIDTokenSource(idt *IDToken) IDTokenSource
StaticIDTokenSource returns an `IDTokenSource` which always returns the given `IDToken`.
type PKCE ¶
PKCE specifies the challenge and value pair required to fulfill RFC7636
func NewPKCE ¶
NewPKCE creates a new PKCE challenge for the specified provider per its supported methods (obtained through OIDC discovery endpoint)
func (*PKCE) AuthURLOpts ¶
func (p *PKCE) AuthURLOpts() []oauth2.AuthCodeOption
AuthURLOpts returns the set of request parameters required during the initial exchange of the OAuth2 flow
func (*PKCE) TokenURLOpts ¶
func (p *PKCE) TokenURLOpts() []oauth2.AuthCodeOption
TokenURLOpts returns the set of request parameters required during the token request exchange flow