Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var RequiredScopes = []string{}/* 101 elements not displayed */
Functions ¶
func CreateClientAssertion ¶ added in v1.15.0
func CreateClientAssertion(alg jwa.SignatureAlgorithm, signingKey, clientID, audience string) (string, error)
CreateClientAssertion creates a JWT token for client authentication with the specified lifetime.
func DetermineSigningAlgorithm ¶ added in v1.15.0
func DetermineSigningAlgorithm(alg string) (jwa.SignatureAlgorithm, error)
DetermineSigningAlgorithm returns the appropriate JWA signature algorithm based on the string representation.
Types ¶
type ClientCredentials ¶ added in v0.13.1
ClientCredentials encapsulates all data to facilitate access token creation with client credentials (client ID and client secret).
type Credentials ¶ added in v1.0.0
type Credentials struct {
Audience string
ClientID string
DeviceCodeEndpoint string
OauthTokenEndpoint string
}
Credentials is used to facilitate the login process.
type PrivateKeyJwtTokenSource ¶ added in v1.15.0
type PrivateKeyJwtTokenSource struct {
Ctx context.Context
URI string
ClientID string
ClientAssertionSigningAlg string
ClientAssertionPrivateKey string
Audience string
}
PrivateKeyJwtTokenSource implements oauth2.TokenSource for Private Key JWT client authentication.
type Result ¶
func GetAccessTokenFromClientCreds ¶ added in v0.13.1
func GetAccessTokenFromClientCreds(ctx context.Context, args ClientCredentials) (Result, error)
GetAccessTokenFromClientCreds generates an access token from client credentials.
func GetAccessTokenFromClientPrivateJWT ¶ added in v1.15.0
func GetAccessTokenFromClientPrivateJWT(args PrivateKeyJwtTokenSource) (Result, error)
GetAccessTokenFromClientPrivateJWT generates an access token from client prviateJWT.
type State ¶
type State struct {
DeviceCode string `json:"device_code"`
UserCode string `json:"user_code"`
VerificationURI string `json:"verification_uri_complete"`
ExpiresIn int `json:"expires_in"`
Interval int `json:"interval"`
}
func GetDeviceCode ¶ added in v1.0.0
func GetDeviceCode(ctx context.Context, httpClient *http.Client, additionalScopes []string, domain string) (State, error)
GetDeviceCode kicks-off the device authentication flow by requesting a device code from Auth0. The returned state contains the URI for the next step of the flow.