Documentation
¶
Overview ¶
Package oauth2 provides OAuth2 authentication utilities for the PingOne Go Client SDK. It includes grant type definitions, token authentication methods, and endpoint configuration for OAuth2 flows supported by PingOne services.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AllowedTokenAuthMethods = map[GrantType][]TokenAuthType{ GrantTypeClientCredentials: { TokenAuthTypeClientSecretBasic, TokenAuthTypeClientSecretPost, }, }
AllowedTokenAuthMethods maps each grant type to its supported token authentication methods. This mapping ensures that only compatible authentication methods are used with each grant type. The map helps validate authentication configurations and provides available options for each flow.
Functions ¶
This section is empty.
Types ¶
type GrantType ¶
type GrantType string
GrantType represents the OAuth2 grant type used for token acquisition. Grant types define the method by which applications obtain access tokens from the authorization server.
const ( // GrantTypeClientCredentials represents the client credentials grant type. // This grant type is used for server-to-server authentication where the client // authenticates directly with the authorization server using its client credentials. GrantTypeClientCredentials GrantType = "client_credentials" )
type TokenAuthType ¶
type TokenAuthType string
TokenAuthType represents the method used to authenticate the client when requesting tokens. These types define how client credentials are transmitted to the authorization server during token requests in OAuth2 flows.
const ( // TokenAuthTypeNone indicates no client authentication is required. // This is typically used for public clients that cannot securely store credentials. TokenAuthTypeNone TokenAuthType = "NONE" // TokenAuthTypeClientSecretBasic indicates client authentication using HTTP Basic authentication. // The client ID and secret are Base64-encoded and sent in the Authorization header. TokenAuthTypeClientSecretBasic TokenAuthType = "CLIENT_SECRET_BASIC" // TokenAuthTypeClientSecretPost indicates client authentication using POST parameters. // The client ID and secret are sent as form parameters in the request body. TokenAuthTypeClientSecretPost TokenAuthType = "CLIENT_SECRET_POST" )