These changes affect only code written against a beta version such as v1.14.0-beta.2
- Renamed
WorkloadIdentityCredentialOptions.EnableAzureTokenProxytoEnableAzureProxy
- Removed extraneous JSON from
AzureDeveloperCLICredentialerrors
These changes affect only code written against a beta version such as v1.13.0-beta.1
WorkloadIdentityCredentialidentity binding mode is disabled by default. To enable it, setWorkloadIdentityCredentialOptions.EnableAzureTokenProxytotrue- Removed identity binding mode support from
DefaultAzureCredential. To use this feature, useWorkloadIdentityCredentialdirectly instead and setWorkloadIdentityCredentialOptions.EnableAzureTokenProxytotrue
AzureCLICredentialquoted arguments incorrectly on Windows
AzureCLICredentialquoted arguments incorrectly on Windows
- Restored the
WorkloadIdentityCredentialidentity binding mode support removed in v1.13.0
- Added
AzurePowerShellCredential, which authenticates as the identity logged in to Azure PowerShell (thanks ArmaanMcleod) - When
AZURE_TOKEN_CREDENTIALSis set toManagedIdentityCredential,DefaultAzureCredentialbehaves the same as doesManagedIdentityCredentialwhen used directly. It doesn't apply special retry configuration or attempt to determine whether IMDS is available. (#25265)
- Removed the
WorkloadIdentityCredentialsupport for identity binding mode added in v1.13.0-beta.1. It will return in v1.14.0-beta.1
- Added
AzurePowerShellCredential, which authenticates as the identity logged in to Azure PowerShell (thanks ArmaanMcleod) WorkloadIdentityCredentialsupports identity binding mode (#25056)
- Added
DefaultAzureCredentialOptions.RequireAzureTokenCredentials.NewDefaultAzureCredentialreturns an error when this option is true and the environment variableAZURE_TOKEN_CREDENTIALShas no value.
AzureDeveloperCLICredentialno longer hangs when AZD_DEBUG is setGetTokenmethods ofAzureCLICredentialandAzureDeveloperCLICredentialreturn an error whenTokenRequestOptions.Claimshas a value because these credentials can't acquire a token in that case. The error messages describe the action required to get a token.
DefaultAzureCredentialtries its next credential when a dev tool credential such asAzureCLICredentialreturns an error
DefaultAzureCredentialallows selecting one of its credential types by name via environment variableAZURE_TOKEN_CREDENTIALS. It will use only the selected type at runtime. For example, setAZURE_TOKEN_CREDENTIALS=WorkloadIdentityCredentialto haveDefaultAzureCredentialuse onlyWorkloadIdentityCredential.
- By default,
ManagedIdentityCredentialretries IMDS requests for a maximum of ~70 seconds as recommended in IMDS documentation. In previous versions, it would stop retrying after ~54 seconds by default.
AzureCLICredentialandAzureDeveloperCLICredentialcould wait indefinitely for subprocess output
DefaultAzureCredentialreads environment variableAZURE_TOKEN_CREDENTIALSto enable a subset of its credentials:devselectsAzureCLICredentialandAzureDeveloperCLICredentialprodselectsEnvironmentCredential,WorkloadIdentityCredentialandManagedIdentityCredential
GetToken()setsAccessToken.RefreshOnwhen the token provider specifies a value
NewManagedIdentityCredentiallogs the configured user-assigned identity, if any- Deprecated
UsernamePasswordCredentialbecause it can't support multifactor authentication (MFA), which Microsoft Entra ID requires for most tenants. See https://aka.ms/azsdk/identity/mfa for migration guidance. - Updated dependencies
- Upgraded dependencies
- User credential types inconsistently log access token scopes
DefaultAzureCredentialskips managed identity in Azure Container Instances- Credentials having optional tenant IDs such as
AzureCLICredentialandInteractiveBrowserCredentialrequire settingAdditionallyAllowedTenantswhen used with some clients
ChainedTokenCredentialandDefaultAzureCredentialcontinue to their next credential afterManagedIdentityCredentialreceives an unexpected response from IMDS, indicating the response is from something else such as a proxy
AzurePipelinesCredentialsets an additional OIDC request header so that it receives a 401 instead of a 302 after presenting an invalid system access token- Allow logging of debugging headers for
AzurePipelinesCredentialand include them in error messages
- Added
ObjectIDtype forManagedIdentityCredentialOptions.ID
- Removed redundant content from error messages
NewManagedIdentityCredentialnow returns an error when a user-assigned identity is specified on a platform whose managed identity API doesn't support that.ManagedIdentityCredential.GetToken()formerly logged a warning in these cases. Returning an error instead prevents the credential authenticating an unexpected identity, causing a client to act with unexpected privileges. The affected platforms are:- Azure Arc
- Azure ML (when a resource ID is specified; client IDs are supported)
- Cloud Shell
- Service Fabric
- If
DefaultAzureCredentialreceives a non-JSON response when probing IMDS before attempting to authenticate a managed identity, it continues to the next credential in the chain instead of immediately returning an error.
- Restored persistent token caching feature
These changes affect only code written against a beta version such as v1.7.0-beta.1
- Redesigned the persistent caching API. Encryption is now required in all cases
and persistent cache construction is separate from credential construction.
The
PersistentUserAuthenticationexample in the package docs has been updated to demonstrate the new API.
AzurePipelinesCredentialauthenticates an Azure Pipelines service connection with workload identity federation
These changes affect only code written against a beta version such as v1.7.0-beta.1
- Removed the persistent token caching API. It will return in v1.8.0-beta.1
- Restored
AzurePipelinesCredentialand persistent token caching API
These changes affect only code written against a beta version such as v1.6.0-beta.4
- Values which
NewAzurePipelinesCredentialread from environment variables in prior versions are now parameters - Renamed
AzurePipelinesServiceConnectionCredentialOptionstoAzurePipelinesCredentialOptions
- Managed identity bug fixes
NewOnBehalfOfCredentialWithClientAssertionscreates an on-behalf-of credential that authenticates with client assertions such as federated credentials
These changes affect only code written against a beta version such as v1.6.0-beta.4
- Removed
AzurePipelinesCredentialand the persistent token caching API. They will return in v1.7.0-beta.1
- Managed identity bug fixes
AzurePipelinesCredentialauthenticates an Azure Pipeline service connection with workload identity federation
DefaultAzureCredentialnow sends a probe request with no retries for IMDS managed identity environments to avoid excessive retry delays when the IMDS endpoint is not available. This should improve credential chain resolution for local development scenarios.
ManagedIdentityCredentialnow specifies resource IDs correctly for Azure Container Instances
ManagedIdentityCredentialnow specifies resource IDs correctly for Azure Container Instances
- Restored v1.4.0 error behavior for empty tenant IDs
- Upgraded dependencies
These changes affect only code written against a beta version such as v1.6.0-beta.1
- Replaced
ErrAuthenticationRequiredwithAuthenticationRequiredError, a struct type that carries theTokenRequestOptionspassed to theGetTokencall which returned the error.
- Fixed more cases in which credential chains like
DefaultAzureCredentialshould try their next credential after attempting managed identity authentication in a Docker Desktop container
AzureCLICredentialuses the CLI'sexpires_onvalue for token expiration
- Restored persistent token caching API first added in v1.5.0-beta.1
- Added
AzureCLICredentialOptions.Subscription
InteractiveBrowserCredentialhandlesAdditionallyAllowedTenantscorrectly
These changes affect only code written against a beta version such as v1.5.0-beta.1
- Removed persistent token caching. It will return in v1.6.0-beta.1
- Credentials now preserve MSAL headers e.g. X-Client-Sku
- Upgraded dependencies
DefaultAzureCredentialandManagedIdentityCredentialsupport Azure ML managed identity- Added spans for distributed tracing.
- Optional persistent token caching for most credentials. Set
TokenCachePersistenceOptionson a credential's options to enable and configure this. See the package documentation for this version and TOKEN_CACHING.md for more details. AzureDeveloperCLICredentialauthenticates with the Azure Developer CLI (azd). This credential is also part of theDefaultAzureCredentialauthentication flow.
ManagedIdentityCredentialwill now retry when IMDS responds 410 or 503
- Service principal credentials can request CAE tokens
These changes affect only code written against a beta version such as v1.4.0-beta.4
- Whether
GetTokenrequests a CAE token is now determined byTokenRequestOptions.EnableCAE. Azure SDK clients which support CAE will set this option automatically. Credentials no longer request CAE tokens by default or observe the environment variable "AZURE_IDENTITY_DISABLE_CP1".
- Credential chains such as
DefaultAzureCredentialnow try their next credential, if any, when managed identity authentication fails in a Docker Desktop container (#21417)
- Upgraded dependencies
- Upgraded dependencies
- One invocation of
AzureCLICredential.GetToken()andOnBehalfOfCredential.GetToken()can no longer make two authentication attempts
DefaultAzureCredentialOptions.TenantIDapplies to workload identity authentication- Upgraded dependencies
- Re-enabled CAE support as in v1.3.0-beta.3
These changes affect only code written against a beta version such as v1.3.0-beta.5
- Renamed
NewOnBehalfOfCredentialFromCertificatetoNewOnBehalfOfCredentialWithCertificate - Renamed
NewOnBehalfOfCredentialFromSecrettoNewOnBehalfOfCredentialWithSecret
- Upgraded to MSAL v1.0.0
These changes affect only code written against a beta version such as v1.3.0-beta.4
- Moved
NewWorkloadIdentityCredential()parameters intoWorkloadIdentityCredentialOptions. The constructor now reads default configuration from environment variables set by the Azure workload identity webhook by default. (#20478) - Removed CAE support. It will return in v1.4.0-beta.1 (#20479)
- Fixed an issue in
DefaultAzureCredentialthat could cause the managed identity endpoint check to fail in rare circumstances.
- Added
WorkloadIdentityCredentialOptions.AdditionallyAllowedTenantsand.DisableInstanceDiscovery
- Credentials now synchronize within
GetToken()so a single instance can be shared among goroutines (#20044)
- Upgraded dependencies
- Upgraded dependencies
- By default, credentials set client capability "CP1" to enable support for Continuous Access Evaluation (CAE). This indicates to Microsoft Entra ID that your application can handle CAE claims challenges. You can disable this behavior by setting the environment variable "AZURE_IDENTITY_DISABLE_CP1" to "true".
InteractiveBrowserCredentialOptions.LoginHintenables pre-populating the login prompt with a username (#15599)- Service principal and user credentials support ADFS authentication on Azure Stack. Specify "adfs" as the credential's tenant.
- Applications running in private or disconnected clouds can prevent credentials from
requesting Microsoft Entra instance metadata by setting the
DisableInstanceDiscoveryfield on credential options. - Many credentials can now be configured to authenticate in multiple tenants. The
options types for these credentials have an
AdditionallyAllowedTenantsfield that specifies additional tenants in which the credential may authenticate.
- Added
OnBehalfOfCredentialto support the on-behalf-of flow (#16642)
AzureCLICredentialreports token expiration in local time (should be UTC)
AzureCLICredentialimposes its default timeout only when theContextpassed toGetToken()has no deadline- Added
NewCredentialUnavailableError(). This function constructs an error indicating a credential can't authenticate and an encompassingChainedTokenCredentialshould try its next credential, if any.
WorkloadIdentityCredentialandDefaultAzureCredentialsupport Workload Identity Federation on Kubernetes.DefaultAzureCredentialsupport requires environment variable configuration as set by the Workload Identity webhook. (#15615)
- This version includes all fixes and features from 1.2.0-beta.*
ManagedIdentityCredentialcaches tokens in memory
ClientCertificateCredentialsends only the leaf cert for SNI authentication
- Added
ClientAssertionCredentialto enable applications to authenticate with custom client assertions
- Updated AuthenticationFailedError with links to TROUBLESHOOTING.md for relevant errors
- Upgraded
microsoft-authentication-library-for-gorequirement to v0.6.0
EnvironmentCredentialreads certificate passwords fromAZURE_CLIENT_CERTIFICATE_PASSWORD(#17099)
ClientCertificateCredentialandClientSecretCredentialsupport ESTS-R. First-party applications can set environment variableAZURE_REGIONAL_AUTHORITY_NAMEwith a region name. (#15605)
- Upgrade
microsoft-authentication-library-for-gorequirement to v0.5.1 (#18176)
DefaultAzureCredentialreads environment variableAZURE_CLIENT_IDfor the client ID of a user-assigned managed identity (#17293)
- Removed
AuthorizationCodeCredential. UseInteractiveBrowserCredentialinstead to authenticate a user with the authorization code flow. - Instances of
AuthenticationFailedErrorare now returned by pointer. GetToken()returnsazcore.AccessTokenby value
AzureCLICredentialpanics after receiving an unexpected error type (#17490)
GetToken()returns an error when the caller specifies no scope- Updated to the latest versions of
golang.org/x/crypto,azcoreandinternal
- This module now requires Go 1.18
- Removed
AuthorityHost. Credentials are now configured for sovereign or private clouds with the API inazcore/cloud, for example:// before opts := azidentity.ClientSecretCredentialOptions{AuthorityHost: azidentity.AzureGovernment} cred, err := azidentity.NewClientSecretCredential(tenantID, clientID, secret, &opts) // after import "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" opts := azidentity.ClientSecretCredentialOptions{} opts.Cloud = cloud.AzureGovernment cred, err := azidentity.NewClientSecretCredential(tenantID, clientID, secret, &opts)
- Prevented a data race in
DefaultAzureCredentialandChainedTokenCredential(#17144)
- Upgraded App Service managed identity version from 2017-09-01 to 2019-08-01 (#17086)
EnvironmentCredentialsupports certificate SNI authentication whenAZURE_CLIENT_SEND_CERTIFICATE_CHAINis "true". (#16851)
ManagedIdentityCredential.GetToken()now returns an error when configured for a user assigned identity in Azure Cloud Shell (which doesn't support such identities) (#16946)
NewDefaultAzureCredential()logs non-fatal errors. These errors are also included in the error returned byDefaultAzureCredential.GetToken()when it's unable to acquire a token from any source. (#15923)
- Replaced
AuthenticationFailedError.RawResponse()with a field having the same name - Unexported
CredentialUnavailableError - Instances of
ChainedTokenCredentialwill now skip looping through the list of source credentials and re-use the first successful credential on subsequent calls toGetToken.- If
ChainedTokenCredentialOptions.RetrySourcesis true,ChainedTokenCredentialwill continue to try all of the originally provided credentials each time theGetTokenmethod is called. ChainedTokenCredential.successfulCredentialwill contain a reference to the last successful credential.DefaultAzureCredenialwill also re-use the first successful credential on subsequent calls toGetToken.DefaultAzureCredential.chain.successfulCredentialwill also contain a reference to the last successful credential.
- If
ManagedIdentityCredentialno longer probes IMDS before requesting a token from it. Also, an error response from IMDS no longer disables a credential instance. Following an error, a credential instance will continue to send requests to IMDS as necessary.- Adopted MSAL for user and service principal authentication
- Updated
azcorerequirement to 0.21.0
- Raised minimum go version to 1.16
- Removed
NewAuthenticationPolicy()from credentials. Clients should instead use azcore'sruntime.NewBearerTokenPolicy()to construct a bearer token authorization policy. - The
AuthorityHostfield in credential options structs is now a custom type,AuthorityHost, with underlying typestring NewChainedTokenCredentialhas a new signature to accommodate a placeholder options struct:// before cred, err := NewChainedTokenCredential(credA, credB) // after cred, err := NewChainedTokenCredential([]azcore.TokenCredential{credA, credB}, nil)
- Removed
ExcludeAzureCLICredential,ExcludeEnvironmentCredential, andExcludeMSICredentialfromDefaultAzureCredentialOptions NewClientCertificateCredentialrequires a[]*x509.Certificateandcrypto.PrivateKeyinstead of a path to a certificate file. AddedParseCertificatesto simplify getting these in common cases:// before cred, err := NewClientCertificateCredential("tenant", "client-id", "/cert.pem", nil) // after certData, err := os.ReadFile("/cert.pem") certs, key, err := ParseCertificates(certData, password) cred, err := NewClientCertificateCredential(tenantID, clientID, certs, key, nil)
- Removed
InteractiveBrowserCredentialOptions.ClientSecretand.Port - Removed
AADAuthenticationFailedError - Removed
idparameter ofNewManagedIdentityCredential(). User assigned identities are now specified byManagedIdentityCredentialOptions.ID:// before cred, err := NewManagedIdentityCredential("client-id", nil) // or, for a resource ID opts := &ManagedIdentityCredentialOptions{ID: ResourceID} cred, err := NewManagedIdentityCredential("/subscriptions/...", opts) // after clientID := ClientID("7cf7db0d-...") opts := &ManagedIdentityCredentialOptions{ID: clientID} // or, for a resource ID resID: ResourceID("/subscriptions/...") opts := &ManagedIdentityCredentialOptions{ID: resID} cred, err := NewManagedIdentityCredential(opts)
DeviceCodeCredentialOptions.UserPrompthas a new type:func(context.Context, DeviceCodeMessage) error- Credential options structs now embed
azcore.ClientOptions. In addition to changing literal initialization syntax, this change renamesHTTPClientfields toTransport. - Renamed
LogCredentialtoEventCredential AzureCLICredentialno longer reads the environment variableAZURE_CLI_PATHNewManagedIdentityCredentialno longer reads environment variablesAZURE_CLIENT_IDandAZURE_RESOURCE_ID. UseManagedIdentityCredentialOptions.IDinstead.- Unexported
AuthenticationFailedErrorandCredentialUnavailableErrorstructs. In their place are two interfaces having the same names.
AzureCLICredential.GetTokenno longer mutates itsopts.Scopes
- Added connection configuration options to
DefaultAzureCredentialOptions AuthenticationFailedError.RawResponse()returns the HTTP response motivating the error, if available
NewDefaultAzureCredential()returns*DefaultAzureCredentialinstead of*ChainedTokenCredential- Added
TenantIDfield toDefaultAzureCredentialOptionsandAzureCLICredentialOptions
- Unexported
AzureCLICredentialOptions.TokenProviderand its type,AzureCLITokenProvider
ManagedIdentityCredential.GetTokenreturnsCredentialUnavailableErrorwhen IMDS has no assigned identity, signalingDefaultAzureCredentialto try other credentials
- Update based on
azcorerefactor #15383
ManagedIdentityCredential.GetTokenno longer mutates itsopts.Scopes
- Bumps version of
azcoretov0.18.1
- Adding support for Service Fabric environment in
ManagedIdentityCredential - Adding an option for using a resource ID instead of client ID in
ManagedIdentityCredential
- Add LICENSE.txt and bump version information
- Add support for authenticating in Azure Stack environments
- Enable user assigned identities for the IMDS scenario in
ManagedIdentityCredential - Add scope to resource conversion in
GetToken()onManagedIdentityCredential
- Updating documentation
- Adding port option to
InteractiveBrowserCredential
- Add
redirectURIparameter back to authentication code flow
- Updating query parameter in
ManagedIdentityCredentialand updating datetime string for parsing managed identity access tokens.
- Remove
RedirectURLparameter from auth code flow to align with the MSAL implementation which relies on the native client redirect URL.
- Flattening credential options
- Adding Azure Arc support in
ManagedIdentityCredential
- Typo fixes
- Ensure authority hosts are only HTTPs
- Adding options structs for credentials
- Update
DeviceCodeCredentialcallback
- Add
AuthorizationCodeCredential
- Add
InteractiveBrowserCredential
- Refactor
azidentityon top ofazcorerefactor - Updated policies to conform to
policy.Policyinterface changes. - Updated non-retriable errors to conform to
azcore.NonRetriableError. - Fixed calls to
Request.SetBody()to include content type. - Switched endpoints to string types and removed extra parsing code.
- Add
AzureCLICredentialtoDefaultAzureCredentialchain
- Initial Release. Azure Identity library that provides Microsoft Entra token authentication support for the SDK.