Documentation
¶
Overview ¶
Package oauth2 provides an implementation of the auth.ProviderConnector interface using the Client Credentials Flow (RFC 6749). It acts as a bridge between the SDK's internal authentication ports and the standard golang.org/x/oauth2 library.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProviderConnector ¶
type ProviderConnector struct {
// contains filtered or unexported fields
}
ProviderConnector implements auth.ProviderConnector. It uses the OAuth2 Client Credentials grant type to exchange a Client ID and Client Secret for an access token.
func NewProviderConnector ¶
func NewProviderConnector(credentialsRepository auth.CredentialsRepository, tokenURL string, scopes []string) *ProviderConnector
NewProviderConnector creates a new connector instance. tokenURL is the specific endpoint of the Identity Provider (IdP). scopes are the permissions requested for the token.
func (*ProviderConnector) RequestToken ¶
RequestToken retrieves the credentials from the repository and exchanges them for a new OAuth2 token using the configured IdP.