Documentation
¶
Overview ¶
Package auth provides an Azure AD (MSAL) token provider implementation backed by a persistent MSAL cache. It supports silent authentication with fallback to interactive or device-code flows.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MSALTokenProvider ¶
type MSALTokenProvider struct {
// contains filtered or unexported fields
}
MSALTokenProvider implements azcore.TokenCredential using the Microsoft Authentication Library (MSAL). Tokens are acquired silently from cache when possible and fall back to the configured interactive or device-code flow.
func GetMSALTokenProvider ¶
func GetMSALTokenProvider(cfg *config.AuthConfig) (*MSALTokenProvider, error)
func NewMSALTokenProvider ¶
func NewMSALTokenProvider(cfg *config.AuthConfig) (*MSALTokenProvider, error)
NewMSALTokenProvider creates a token provider backed by a persistent MSAL cache stored in the user's cache directory.
func (*MSALTokenProvider) GetToken ¶
func (p *MSALTokenProvider) GetToken(ctx context.Context, _ policy.TokenRequestOptions) (azcore.AccessToken, error)
GetToken implements azcore.TokenCredential.
It attempts to acquire a token silently using cached accounts. If no matching account is found or silent acquisition fails, it falls back to the configured authentication flow.