oauth2

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64urlSha256

func Base64urlSha256(value string) string

func ParseTokenResponse

func ParseTokenResponse(tokenResponse []byte) (map[string]interface{}, string, error)

Types

type AbstractAuthCodeClient added in v1.9.0

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

func (AbstractAuthCodeClient) GetName added in v1.9.0

func (a AbstractAuthCodeClient) GetName() string

func (AbstractAuthCodeClient) GetTokenResponse added in v1.9.0

func (a AbstractAuthCodeClient) GetTokenResponse(req *http.Request, callbackURL *url.URL) (map[string]interface{}, error)

GetTokenResponse 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(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 {
	GetName() string
	GetTokenResponse(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 {
	Backend http.RoundTripper
	// contains filtered or unexported fields
}

Client represents an OAuth2 client.

type ClientCredentialsClient added in v1.9.0

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

ClientCredentialsClient represents an OAuth2 client using the client credentials flow.

func NewClientCredentialsClient added in v1.9.0

func NewClientCredentialsClient(conf *config.OAuth2ReqAuth, backend http.RoundTripper) (*ClientCredentialsClient, error)

NewClientCredentialsClient creates a new OAuth2 Client Credentials client.

func (*ClientCredentialsClient) GetTokenResponse added in v1.9.0

func (c *ClientCredentialsClient) GetTokenResponse(ctx context.Context) ([]byte, map[string]interface{}, string, error)

GetTokenResponse retrieves the response from the token endpoint

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(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