Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider performs the OAuth2 authorization code flow with OIDC discovery to obtain an id_token for Azure workload identity federation.
func NewProvider ¶
NewProvider initializes an OIDC provider via discovery and prepares a local callback listener for the authorization code flow. PKCE (S256) is enabled by default unless the config explicitly sets pkce to "disabled". The cacheDir is used to store cached id_tokens on disk.
func (*Provider) AcquireToken ¶
func (p *Provider) AcquireToken(ctx context.Context, opts ...wif.AcquireOption) (idToken string, cached bool, err error)
AcquireToken performs the OAuth2 authorization code flow and returns the id_token from the token response. The id_token is a signed JWT suitable for use as a federated credential with Azure workload identity login (az login --federated-token).
Cached tokens are returned when available unless wif.WithForceRefresh is passed.