oauth2

package
v0.1.15 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

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

func (c *ProviderConnector) RequestToken(ctx context.Context) (*auth.Token, error)

RequestToken retrieves the credentials from the repository and exchanges them for a new OAuth2 token using the configured IdP.

Jump to

Keyboard shortcuts

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