Versions in this module Expand all Collapse all v1 v1.23.14 Apr 4, 2026 v1.23.13 Mar 26, 2026 Changes in this version + var ErrNoCurrentUser = errors.New("not logged in, run `azd auth login` to login") + func EnsureLoggedInCredential(ctx context.Context, credential azcore.TokenCredential, cloud *cloud.Cloud) (*azcore.AccessToken, error) + func GetOidFromAccessToken(token string) (string, error) + func GetTenantIdFromToken(token string) (string, error) + func LoginScopes(cloud *cloud.Cloud) []string + func LoginScopesFull(cloud *cloud.Cloud) []string + type AadErrorResponse struct + CorrelationId string + Error string + ErrorCodes []int + ErrorDescription string + ErrorUri string + Timestamp string + TraceId string + type AuthFailedError struct + Parsed *AadErrorResponse + RawResp *http.Response + func (e *AuthFailedError) Error() string + func (e *AuthFailedError) NonRetriable() + func (e *AuthFailedError) Unwrap() error + type AuthSource string + const AzDelegated + const AzdBuiltIn + const ExternalRequest + type Cache interface + Read func(key string) ([]byte, error) + Set func(key string, value []byte) error + type ClaimsForCurrentUserOptions = CredentialForCurrentUserOptions + type CloudShellCredential struct + func NewCloudShellCredential(transporter policy.Transporter) *CloudShellCredential + func (t CloudShellCredential) GetToken(ctx context.Context, options policy.TokenRequestOptions) (azcore.AccessToken, error) + type CredentialForCurrentUserOptions struct + NoPrompt bool + TenantID string + type ExternalAuthConfiguration struct + Endpoint string + Key string + Transporter policy.Transporter + type FederatedTokenClient struct + func NewFederatedTokenClient(idTokenUrl string, token string, options azcore.ClientOptions) *FederatedTokenClient + func (c *FederatedTokenClient) TokenForAudience(ctx context.Context, audience string) (string, error) + type HttpClient interface + CloseIdleConnections func() + Do func(*http.Request) (*http.Response, error) + type LogInDetails struct + Account string + LoginType LoginType + type LoginInteractiveOptions struct + RedirectPort int + TenantID string + WithOpenUrl WithOpenUrl + type LoginType string + const ClientIdLoginType + const EmailLoginType + type Manager struct + func NewManager(configManager config.FileConfigManager, ...) (*Manager, error) + func (m *Manager) ClaimsForCurrentUser(ctx context.Context, options *ClaimsForCurrentUserOptions) (TokenClaims, error) + func (m *Manager) Cloud() *cloud.Cloud + func (m *Manager) CredentialForCurrentUser(ctx context.Context, options *CredentialForCurrentUserOptions) (azcore.TokenCredential, error) + func (m *Manager) GetLoggedInServicePrincipalTenantID(ctx context.Context) (*string, error) + func (m *Manager) LogInDetails(ctx context.Context) (*LogInDetails, error) + func (m *Manager) LoginInteractive(ctx context.Context, scopes []string, claims string, ...) (azcore.TokenCredential, error) + func (m *Manager) LoginScopes() []string + func (m *Manager) LoginWithAzurePipelinesFederatedTokenProvider(ctx context.Context, tenantID string, clientID string, ...) (azcore.TokenCredential, error) + func (m *Manager) LoginWithBrokerAccount() error + func (m *Manager) LoginWithDeviceCode(ctx context.Context, tenantID string, scopes []string, claims string, ...) (azcore.TokenCredential, error) + func (m *Manager) LoginWithGitHubFederatedTokenProvider(ctx context.Context, tenantId, clientId string) (azcore.TokenCredential, error) + func (m *Manager) LoginWithManagedIdentity(ctx context.Context, clientID string) (azcore.TokenCredential, error) + func (m *Manager) LoginWithOidcFederatedTokenProvider(ctx context.Context, tenantId, clientId string) (azcore.TokenCredential, error) + func (m *Manager) LoginWithOneAuth(ctx context.Context, tenantID string, scopes []string) error + func (m *Manager) LoginWithServicePrincipalCertificate(ctx context.Context, tenantId, clientId string, certData []byte) (azcore.TokenCredential, error) + func (m *Manager) LoginWithServicePrincipalSecret(ctx context.Context, tenantId, clientId, clientSecret string) (azcore.TokenCredential, error) + func (m *Manager) Logout(ctx context.Context) error + func (m *Manager) Mode() (AuthSource, error) + func (m *Manager) SetBuiltInAuthMode() error + func (m *Manager) UseExternalAuth() bool + type MultiTenantCredentialProvider interface + GetTokenCredential func(ctx context.Context, tenantId string) (azcore.TokenCredential, error) + func NewMultiTenantCredentialProvider(auth *Manager) MultiTenantCredentialProvider + type ReLoginRequiredError struct + func (e *ReLoginRequiredError) Error() string + func (e *ReLoginRequiredError) NonRetriable() + type RemoteCredential struct + func (rc *RemoteCredential) GetToken(ctx context.Context, options policy.TokenRequestOptions) (azcore.AccessToken, error) + type TokenClaims struct + AlternativeId string + Audience string + Email string + ExpirationTime int64 + FamilyName string + GivenName string + IssuedAt int64 + Issuer string + MiddleName string + Name string + NotBefore int64 + Oid string + PreferredUsername string + Subject string + TenantId string + UniqueName string + Upn string + func GetClaimsFromAccessToken(token string) (TokenClaims, error) + func (tc *TokenClaims) DisplayUsername() string + func (tc *TokenClaims) LocalAccountId() string + type TokenFromCloudShell struct + AccessToken string + ExpiresIn json.Number + ExpiresOn json.Number + NotBefore json.Number + RefreshToken string + Resource string + TokenType string + type UserAgent string + type WithOpenUrl func(url string) error