oauth2

package
v1.12.2 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64urlSha256

func Base64urlSha256(value string) string

Types

type AbstractAuthCodeClient added in v1.9.0

type AbstractAuthCodeClient struct {
	AuthCodeFlowClient
	*Client
	// contains filtered or unexported fields
}

func (AbstractAuthCodeClient) ExchangeCodeAndGetTokenResponse added in v1.10.0

func (a AbstractAuthCodeClient) 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 AuthCodeClient added in v1.9.0

type AuthCodeClient struct {
	*AbstractAuthCodeClient
}

AuthCodeClient represents an OAuth2 client using the (plain) authorization code flow.

func NewAuthCodeClient added in v1.9.0

func NewAuthCodeClient(evalCtx *hcl.EvalContext, acClientConf config.OAuth2AcClient, oauth2AsConf config.OAuth2AS, backend http.RoundTripper) (*AuthCodeClient, error)

NewAuthCodeClient creates a new OAuth2 Authorization Code client.

type AuthCodeFlowClient added in v1.9.0

type AuthCodeFlowClient interface {
	ExchangeCodeAndGetTokenResponse(req *http.Request, callbackURL *url.URL) (map[string]interface{}, error)
	// contains filtered or unexported methods
}

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 added in v1.10.0

func NewClient(evalCtx *hcl.EvalContext, grantType string, asConfig config.OAuth2AS, clientConfig config.OAuth2Client, backend http.RoundTripper) (*Client, error)

func (*Client) GetTokenResponse added in v1.10.0

func (c *Client) GetTokenResponse(ctx context.Context, formParams url.Values) (map[string]interface{}, string, 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 added in v1.9.0

func NewOidcClient(evalCtx *hcl.EvalContext, oidcConfig *oidc.Config) (*OidcClient, error)

NewOidcClient creates a new OIDC client.

func (*OidcClient) Keyfunc added in v1.9.0

func (o *OidcClient) Keyfunc(token *jwt.Token) (interface{}, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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