ManagedIdentityCredential
will now correctly retry when the instance metadata endpoint returns a 410 response. #28568ManagedIdentityCredential
will fall through to the next credential in the chain in the case that Docker Desktop returns a 403 response when attempting to access the IMDS endpoint. #38218BrowserCustomization
property to InteractiveBrowserCredential
to enable web view customization for interactive authentication.IsCaeEnabled
property of TokenRequestContext
via its constructor.IsUnsafeSupportLoggingEnabled
property to TokenCredentialOptions
which equates to passing 'true' for the enablePiiLogging
parameter to the 'WithLogging' method on the MSAL client builder.TokenCachePersistenceOptions
where credentials in the same process would share the same cache, even if they had different configured names.EnvironmentCredential
from DefaultAzureCredential
the credential will now override the TENANT_ID
environment value if the TenantId value is set in DefaultAzureCredentialOptions
.DefaultAzureCredential
credential chain will fall through to the next credential in the chain on any failure. Previously, some exceptions would throw AuthenticationFailedException
, which stops further progress in the chain.EnvironmentCredentialOptions
to internal. These options are again only configurable via environment variables.AzureCliCredential
to AzureCliCredentialOptions.ProcessTimeout
AzurePowerShellCredential
to AzurePowerShellCredentialOptions.ProcessTimeout
VisualStudioCredential
to VisualStudioCredentialOptions.ProcessTimeout
AzureDeveloperCliCredential
to AzureDeveloperCliCredentialOptions.ProcessTimeout
DefaultAzureCredentialOptions.ExcludeWorkloadIdentityCredential
to true
also excludes TokenExchangeManagedIdentitySource
when using DefaultAzureCredential
selects the ManagedIdentityCredential
VisualStudioCredential
on non-Windows platformsAzureDeveloperCliCredential
for Azure Developer CLIWorkloadIdentityCredential
to support Azure Workload Identity authenticationWorkloadIdentityCredential
and AzureDeveloperCliCredential
to the DefaultAzureCredential
authentication flow.ManagedIdentityCredential
authentication in sovereign clouds for services specifying TenantId
through authentication challenge #34077UsernamePasswordCredential
. After this change, ClientCertificateCredential
will be selected, which is consistent with all other languages. This is potentially a behavioral breaking change.AzurePowerShellCredential
which would misinterpret Microsoft Entra ID errors with the need to install PowerShell. #31998ManagedIdentityCredential
. [#32498])(https://github.com/Azure/azure-sdk-for-net/issues/32498)ManagedIdentityCredential
in combination with authorities other than Azure public cloud that resulted in a incorrect instance metadata validation error. #32498AzureCliCredential
which would misinterpret Microsoft Entra ID errors with the need to login with az login
. #26894, #29109ManagedIdentityCredential
will no longer fail when a response received from the endpoint is invalid JSON. It now treats this scenario as if the credential is unavailable. #30467, #32061AzureCliCredential
and AzureCliCredentialOptions.CliProcessTimeout
AzurePowerShellCredential
and AzurePowerShellCredentialOptions.PowerShellProcessTimeout
VisualStudioCredential
and VisualStudioCredentialOptions.VisualStudioProcessTimeout
DefaultAzureCredential
and DefaultAzureCredentialOptions.DeveloperCredentialTimeout
Note: this option applies to all developer credentials above when using DefaultAzureCredential
.Thank you to our developer community members who helped to make Azure Identity better with their contributions to this release:
ManagedIdentityCredential
token caching support from 1.7.0-beta.1EnvironmentCredential
updated to support specifying a certificate password via the AZURE_CLIENT_CERTIFICATE_PASSWORD
environment variableVisualStudioCodeCredential
from DefaultAzureCredential
token chain by default as SDK authentication via Visual Studio Code is broken due to issue #27263. The VisualStudioCodeCredential
will be re-enabled in the DefaultAzureCredential
flow once a fix is in place. Issue #30525 tracks this. In the meantime Visual Studio Code users can authenticate their development environment using the Azure CLI.AdditionallyAllowedTenants
to the following credential options to force explicit opt-in behavior for multi-tenant authentication:
AuthorizationCodeCredentialOptions
AzureCliCredentialOptions
AzurePowerShellCredentialOptions
ClientAssertionCredentialOptions
ClientCertificateCredentialOptions
ClientSecretCredentialOptions
DefaultAzureCredentialOptions
OnBehalfOfCredentialOptions
UsernamePasswordCredentialOptions
VisualStudioCodeCredentialOptions
VisualStudioCredentialOptions
TenantId
to DefaultAzureCredentialOptions
to avoid having to set InteractiveBrowserTenantId
, SharedTokenCacheTenantId
, VisualStudioCodeTenantId
, and VisualStudioTenantId
individually.user_impersonation
#30647AuthenticationFailedException
if the requested tenant ID doesn't match the credential's tenant ID, and is not included in the AdditionallyAllowedTenants
option. Applications must now explicitly add additional tenants to the AdditionallyAllowedTenants
list, or add '*' to list, to enable acquiring tokens from tenants other than the originally specified tenant ID. See BREAKING_CHANGES.md.ManagedIdentityCredential
token caching added in 1.7.0-beta.1 has been removed from this release and will be added back in 1.8.0-beta.1ManagedIdentityCredential
will now internally cache tokens. Apps can call GetToken
or GetTokenAsync
directly without needing to cache to avoid throttling.AZURE_REGIONAL_AUTHORITY_NAME
support in ClientCertificateCredential
#29112SharedTokenCacheCredential
default behavior #28029TokenCacheRefreshArgs
and EnvironmentCredential
(Community contributions, courtesy of pmaytak and goenning)Thank you to our developer community members who helped to make Azure Identity better with their contributions to this release:
Diagnostics
options available on TokenCredentialOptions
and all sub-types. If set to true
, we try to log the account identifiers by parsing the received access token. The account identifiers we try to log are the:
ManagedIdentityCredential
now attempts to use the newest "2019-08-01" api version for App Service Managed Identity sources. The newer API version will be used if the IDENTITY_ENDPOINT
and IDENTITY_HEADER
environment variables are set.OnBehalfOfCredential
when the SendCertificateChain
option is set. #27679EnvironmentCredential
now supports certificate subject name / issuer based authentication with AZURE_CLIENT_SEND_CERTIFICATE_CHAIN
environment variable (A community contribution, courtesy of trevorlacey-msft).ManagedIdentityCredential
now supports accepting a ResourceIdentifier
argument to specify a User Assigned Managed Identity by resource Id rather than client Id. DefaultAzureCredential
also supports this via the ManagedIdentityResourceId
property of DefaultAzureCredentialOptions
.ClientAssertionCredential
for authenticating service principals with a presigned client assertion.AuthenticationFailedException
from AzurePowerSheellCredential
when not logged in on non-windows platforms #23498ManagedIdentityCredential
response parsing to handle non-json responses #24158Thank you to our developer community members who helped to make Azure Identity better with their contributions to this release:
AllowMultiTenantAuthentication
option has been removed and the default behavior is now as if it were true. The multi-tenant discovery feature can be totally disabled by either setting an AppContext
switch named "Azure.Identity.DisableTenantDiscovery" to true
or by setting the environment variable "AZURE_IDENTITY_DISABLE_MULTITENANTAUTH" to "true".IsPIILoggingEnabled
property from TokenCredentialOptions
, similar functionality is planned to be added to TokenCredentialOptions.Diagnostics
in a later release.RegionalAuthority
from ClientCertificateCredentialOptions
and ClientSecretCredentialOptions
, along with the RegionalAuthority
type.TokenCacheDetails
to TokenCacheData
.TokenCacheNotificationDetails
to TokenCacheRefreshArgs
.CacheBytes
property on TokenCacheData
to be readonly and a required constructor parameter.AuthorizationCodeCredential
not specifying correct redirectUrl (Issue #24183)DefaultAzureCredentialOptions
now has a InteractiveBrowserClientId
property which allows passing a ClientId value to the InteractiveBrowserCredential
when constructing a DefaultAzureCredential
.OnBehalfOfCredential
which enables authentication to Microsoft Entra ID using an On-Behalf-Of flow.ManagedIdentityCredential
for Azure hosts using federated token exchange for managed identity.ManagedIdentityCredential
resiliency. #23028UsernamePasswordCredential
to use cached tokens when available #23324MsalConfidentialClient
to include MSAL log output in logsAzureCliCredential
, AzurePowerShellCredential
, VisualStudioCredential
, and VisualStudioCodeCredential
when IsPIILoggingEnabled
is set to true.Thank you to our developer community members who helped to make Azure Identity better with their contributions to this release:
DefaultAzureCredential
selects a credential during initialization.AzureApplicationCredential
IsPIILoggingEnabled
property to TokenCredentialOptions
, which controls whether MSAL PII logging is enabled, and other sensitive credential related logging content.AZURE_POD_IDENTITY_TOKEN_URL
to AZURE_POD_IDENTITY_AUTHORITY_HOST
. The value should now be a host, for example "http://169.254.169.254" (the default).$PROFILE
and checking for updates when using AzurePowerShellCredential
.AzureCliCredential
when specifying the TenantId
option. #23158 (A community contribution, courtesy of tomas-pajurek).az login
when needed. #21758EnvironmentCredential
where the supplied options
were not getting properly applied. #22787RegionalAuthority
extensible enumRegionalAuthority
property to ClientSecretCredentialOptions
and ClientCertificateCredentialOptions
ManagedIdentityCredential
for Bridge to Kubernetes local development authentication.AllowMultiTenantAuthentication
option on TokenCredentialOptions
.
AllowMultiTenantAuthentication
is false. When this option property is false and the tenant Id configured in the credential options differs from the tenant Id set in the TokenRequestContext
sent to a credential, an AuthorizationFailedException
will be thrown. This is potentially breaking change as it could be a different exception than what was thrown previously. This exception behavior can be overridden by either setting an AppContext
switch named "Azure.Identity.EnableLegacyTenantSelection" to true
or by setting the environment variable "AZURE_IDENTITY_ENABLE_LEGACY_TENANT_SELECTION" to "true". Note: AppContext switches can also be configured via configuration like below:OnBehalfOfFlowCredential
which enables support for Microsoft Entra On-Behalf-Of (OBO) flow. See the Microsoft Entra ID documentation to learn more about OBO flow scenarios.<ItemGroup>
<RuntimeHostConfigurationOption Include="Azure.Identity.EnableLegacyTenantSelection" Value="true" />
</ItemGroup>
LoginHint
property to InteractiveBrowserCredentialOptions
which allows a user name to be pre-selected for interactive logins. Setting this option skips the account selection prompt and immediately attempts to login with the specified account.AuthorizationCodeCredentialOptions
which allows for configuration of a ReplyUri.AppContext
switch named "Azure.Identity.DisableCP1" to true
or by setting the environment variable;
"AZURE_IDENTITY_DISABLE_CP1" to "true". Note: AppContext switches can also be configured via configuration like below:<ItemGroup>
<RuntimeHostConfigurationOption Include="Azure.Identity.DisableCP1" Value="true" />
</ItemGroup>
Thank you to our developer community members who helped to make Azure Identity better with their contributions to this release:
AzurePowerShellCredential
to DefaultAzureCredential
(A community contribution, courtesy of olandese)InteractiveBrowserCredential
when running in a UI application (#18418).TokenCache
class is moved removed from the public API surface and has been replaced by TokenCachePersistenceOptions
for configuration of disk based persistence of the token cache.[Serializable]
attribute to all custom exception types.ExcludeSharedTokenCacheCredential
on DefaultAzureCredentialsOptions
to true, to exclude the SharedTokenCacheCredential
from the DefaultAzureCredential
by default. See BREAKING_CHANGES.mdIDisposable
interface has been removed from TokenCache
.Claims
property on TokenRequestContext
HttpExtensions
causing the omission of content headers on requests (#17448)EnvironmentCredential
to account for both null and empty string when checking for the presense of the environment variables (#18031)ManagedIdentityCredential
.ManagedIdentityCredential
.ProcessRunner
causing VisualStudioCredential
and AzureCliCredential
to fail intermittently (#16211)VisualStudioCodeCredential
to raise CredentialUnavailableException
when reading from VS Code's stored secret (#16795)VisualStudioCodeCredential
using invalid authentication data when no user is signed in to Visual Studio Code (#15870)ProcessRunner
causing AzureCliCredential
and VisualStudioCredential
to fail due to timeout (#14691, 14207)AzureCliCredential
incorrectly parsing expires on property returned from az account get-access-token
(#15801)DeviceCodeCredential
and InteractiveBrowserCredential
to improperly authenticate to the home tenant for silent authentication calls after initial authentication (#13801)SharedTokenCacheCredential
on Linux (#12939)IncludeX5CCliamHeader
on ClientCertificateCredentialOptions
to SendCertificateChain
AuthenticationRecord
AuthenticationRequiredException
ClientSecretCredentialOptions
and ClientSecretCredential
constructor overloads accepting this typeUsernamePasswordCredentialOptions
and UsernamePasswordCredential
constructor overloads accepting this typeEnablePersistentCache
and AllowUnprotectedCache
from ClientCertificateCredentialOptions
, DeviceCodeCredentialOptions
and InteractiveBrowserCredentialOptions
AuthenticationRecord
and DisableAutomaticAuthentication
from DeviceCodeCredentialOptions
and InteractiveBrowserCredentialOptions
AllowUnencryptedCache
and AuthenticationRecord
from SharedTokenCacheCredentialOptions
Authenticate
and AuthenticateAsync
from DeviceCodeCredential
, InteractiveBrowserCredential
and UsernamePasswordCredential
TokenCache
and TokenCache
classes to give more user control over how the tokens are cached and how the cache is persisted.TokenCache
property to options for credentials supporting token cache configuration.DeviceCodeCredential
to output device code information and authentication instructions in the console, in the case no deviceCodeCallback
is specified.
DeviceCodeCallback
to DeviceCodeCredentialOptions
DeviceCodeCredential
DeviceCodeCredential
constructor overload taking deviceCodeCallback
and DeviceCodeCredentialOptions
with constructor taking only DeviceCodeCredentialOptions
2019-08-01
(#13687)IncludeX5CClaimHeader
to ClientCertificateCredentialOptions
to enable subject name / issuer authentication with the ClientCertificateCredential
.RedirectUri
to InteractiveBrowserCredentialOptions
to enable authentication with user specified application with a custom redirect url.IdentityModelFactory
to enable constructing models from the Azure.Identity library for mocking.DefaultAzureCredential
and ChainedTokenCredential
(#14408)MsalPublicClient
and MsalConfidentialClient
to respect CancellationToken
during initialization (#13201)VisualStudioCodeCredential
crashes on macOS (Issue #14362)VisualStudioCredential
and VisualStudioCodeCredential
to throw CredentialUnavailableException
for ADFS tenant (Issue #14639)DefaultAzureCredential
incorrectly catching AuthenticationFailedException
(Issue #14974)DefaultAzureCredential
throwing exceptions during concurrent calls (Issue #15013)InteractiveBrowserCredential
not specifying correct redirectUrl (Issue #13940)AuthenticationRecord
AuthenticationRequiredException
ClientCertificateCredentialOptions
and ClientCertificateCredential
constructor overloads accepting this typeClientSecretCredentialOptions
and ClientSecretCredential
constructor overloads accepting this typeDeviceCodeCredentialOptions
and DeviceCodeCredential
constructor overloads accepting this typeInteractiveBrowserCredentialOptions
and InteractiveBrowserCredential
constructor overloads accepting this typeUsernamePasswordCredentialOptions
and UsernamePasswordCredential
constructor overloads accepting this typeAuthenticate
and AuthenticateAsync
from DeviceCodeCredential
Authenticate
and AuthenticateAsync
from InteractiveBrowserCredential
Authenticate
and AuthenticateAsync
from UsernamePasswordCredential
AllowUnencryptedCache
and AuthenticationRecord
from SharedTokenCacheCredentialOptions
DefaultAzureCredential
tracing (Issue #10659)DefaultAzureCredential
(Issue #13044)ClientId
to AuthenticationRecord
.AllowUnencryptedCache
to the option classes ClientCertificateCredentialOptions
, ClientSecretCredentialOptions
, DeviceCodeCredentialOptions
, InteractiveBrowserCredentialOptions
and SharedTokenCacheCredentialOptions
which when set to true allows the credential to fall back to storing tokens in an unencrypted file if no OS level user encryption is available when EnablePersistentCache
is set to true.AuthenticationRecord
to the option class SharedTokenCacheCredentialOptions
to support silent authentication for accounts previously authenticated with an interactive credential.UsernamePasswordCredentialOptions
which supports the options EnablePersistentCache
and AllowUnencryptedCache
.KnownAuthorityHosts
to AzureAuthorityHosts
AzureChinaCloud
to AzureChina
AzureGermanCloud
to AzureGermany
AzureUSGovernment
to AzureGovernment
AzureCloud
to AzurePublicCloud
ClientCertificateCredentialOptions
and ClientSecretCredentialOptions
which support the following new option
EnablePersistentCache
configures these credentials to use a persistent cache shared between credentials which set this option. By default the cache is per credential and in memory only.AzureCliCredential
, VisualStudioCredential
and VisualStudioCodeCredential
public to allow direct usage.Authenticate
methods to UsernamePasswordCredential
SharedTokenCacheCredential
account filter to be case-insensitive (Issue #10816)VisualStudioCodeCredential
to properly throw CredentialUnavailableException
when re-authentication is needed. (Issue #11595)DeviceCodeCredential
and InteractiveBrowserCredential
Authenticate
which pro-actively interacts with the user to authenticate if necessary and returns a serializable AuthenticationRecord
DeviceCodeCredentialOptions
and InteractiveBrowserCredentialOptions
which support the following new optionsAuthenticationRecord
enables initializing a credential with an AuthenticationRecord
returned from a prior call to Authenticate
DisableAutomaticAuthentication
disables automatic user interaction causing the credential to throw an AuthenticationRequiredException
when interactive authentication is necessary.EnablePersistentCache
configures these credentials to use a persistent cache shared between credentials which set this option. By default the cache is per credential and in memory only.DefaultAzureCredential
to enable authenticating through Visual StudioDefaultAzureCredential
to enable authentication through Visual Studio CodeDefaultAzureCredential
to enable authenticating through the Azure CLIClientCertificateCredential
now supports being constructed with a path to an unencrypted certificate (in either PFX or PEM format)EnvironmentCredential
now supports reading a certificate path from AZURE_CLIENT_CERTIFICATE_PATH
EnvironmentCredential
did not behave correctly when AZURE_USERNAME
and AZURE_PASSWORD
where setKnownAuthorityHosts
class to aid in sovereign cloud configuration.UsernamePasswordCredential
constructor parameter mishandlingManagedIdentityCredential
endpoint discovery to avoid throwingManagedIdentityCredential
to raise CredentialUnavailableException
on 400 return from the service where no identity has been assignedDefaultAzureCredential
to more easily root cause failuresSharedTokenCacheCredential
to filter accounts by tenant id
SharedTokenCacheCredentialOptions
class with properties TenantId
and Username
SharedTokenCacheCredential
which accepts SharedTokenCacheCredentialOptions
SharedTokenCacheTenantId
to DefaultAzureCredentialOptions
DefaultAzureCredential
, InteractiveBrowserCredential
, and SharedTokenCacheCredential
InteractiveBrowserTenantId
to DefaultAzureCredentialOptions
ManagedIdentityCredential
authentication with user assigned identitiesAzureCredentialOptions
-> TokenCredentialOptions
VerificationUrl
-> VerificationUri
and changed type from string
to Uri
ClientSecretCredential
class
ClientId
ClientSecret
TenantId
ClientCertificateCredential
class
ClientId
ClientCertificate
TenantId
DefaultAzureCredential
class to derive directly from TokenCredential
rather than ChainedTokenCredential
DefaultAzureCredentialOptions
class
PreferredAccountUsername
-> SharedTokenCacheUsername
IncludeEnvironmentCredential
-> ExcludeEnvironmentCredential
IncludeManagedIdentityCredential
-> ExcludeManagedIdentityCredential
IncludeSharedTokenCacheCredential
-> ExcludeSharedTokenCacheCredential
IncludeInteractiveBrowserCredential
-> ExcludeInteractiveBrowserCredential
DeviceCodeInfo
class
Interval
VerificationUrl
-> VerificationUri
and changed type from string
to Uri
InteractiveBrowserCredential
class
tenantId
and clientId
to be consistent with other credential typesSharedTokenCacheCredential
class
TokenCredentialOptions
clientId
constructor parameterSharedTokenCacheCredentialOptions
TokenCredential
implementations in the Azure.Identity library now throw exceptions rather than returning default
(AccessToken
) when no token is obtainedCredentialUnavailableExcpetion
exception type to distinguish cases when failure to obtain an AccessToken
was expectedManagedIdentityCredential
IMDS availability check to handle immediate network failuresDefaultAzureCredential
constructor overload to enable interactive credential types by defaultDefaultAzureCredentialOptions
for configuring the DefaultAzureCredential
authentication flowInteractiveBrowserCredential
to the DefaultAzureCredential
authentication flow, but excluded by defaultInteractiveBrowserCredential
and DeviceCodeCredential
to optionally accept a tenantId to support non-multitenant applicationsTokenRequest
structure rather than string[]
for forwards compatibilitySharedTokenCacheCredential
to support Single Sign On with developer toolingDefaultAzureCredential
authentication flow to include the SharedTokenCacheCredential
DeviceCodeCredential
classInteractiveBrowserCredential
classUsernamePasswordCredential
classVersion 1.0.0-preview.1 is the first preview of our efforts to create a user-friendly authentication API for Azure SDK client libraries. For more information about preview releases of other Azure SDK libraries, please visit https://aka.ms/azure-sdk-preview1-net.
DefaultAzureCredential
classChainedTokenCredential
classClientSecretCredential
classClientCertificateCredential
classManagedIdentityCredential
classSee the documentation for more details. User authentication will be added in an upcoming preview release.