Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Base64urlSha256 ¶
Base64urlSha256 creates a base64url encoded sha256 hash of the given input string.
Types ¶
type AuthCodeClient ¶
type AuthCodeClient struct {
*Client
// contains filtered or unexported fields
}
AuthCodeClient represents an OAuth2 client using the (plain) authorization code flow.
func NewAuthCodeClient ¶
func NewAuthCodeClient(evalCtx *hcl.EvalContext, acClientConf config.OAuth2AcClient, oauth2AsConf config.OAuth2AS, backend http.RoundTripper) (*AuthCodeClient, error)
NewAuthCodeClient creates a new OAuth2 Authorization Code client.
func (*AuthCodeClient) ExchangeCodeAndGetTokenResponse ¶
func (a *AuthCodeClient) ExchangeCodeAndGetTokenResponse(req *http.Request, callbackURL *url.URL) (map[string]interface{}, error)
ExchangeCodeAndGetTokenResponse exchanges the authorization code and retrieves the response from the token endpoint.
type AuthCodeFlowClient ¶
type AuthCodeFlowClient interface {
// ExchangeCodeAndGetTokenResponse exchanges the authorization code and retrieves the response from the token endpoint.
ExchangeCodeAndGetTokenResponse(req *http.Request, callbackURL *url.URL) (map[string]interface{}, error)
}
AuthCodeFlowClient represents an OAuth2 client using the authorization code flow.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents an OAuth2 client.
func NewClient ¶
func NewClient(evalCtx *hcl.EvalContext, grantType string, asConfig config.OAuth2AS, clientConfig config.OAuth2Client, backend http.RoundTripper) (*Client, error)
type OidcClient ¶
type OidcClient struct {
*AuthCodeClient
// contains filtered or unexported fields
}
OidcClient represents an OpenID Connect client using the authorization code flow.
func NewOidcClient ¶
func NewOidcClient(evalCtx *hcl.EvalContext, oidcConfig *oidc.Config) (*OidcClient, error)
NewOidcClient creates a new OIDC client.
func (*OidcClient) ExchangeCodeAndGetTokenResponse ¶
func (o *OidcClient) ExchangeCodeAndGetTokenResponse(req *http.Request, callbackURL *url.URL) (map[string]interface{}, error)
ExchangeCodeAndGetTokenResponse exchanges the authorization code and retrieves the response from the token endpoint if the ID token is valid.