InteractiveBrowserCredentialraisesCredentialUnavailableErrorwhen it can't start an HTTP server onlocalhost. (#11665)- When constructing
DefaultAzureCredential, you can now configure a tenant ID forInteractiveBrowserCredential. When none is specified, the credential authenticates users in their home tenants. To specify a different tenant, use the keyword argumentinteractive_browser_tenant_id, or set the environment variableAZURE_TENANT_ID. (#11548) - The user authentication API added to
DeviceCodeCredentialandInteractiveBrowserCredentialin 1.4.0b3 is available onUsernamePasswordCredentialas well. (#11449) - The optional persistent cache for
DeviceCodeCredentialandInteractiveBrowserCredentialadded in 1.4.0b3 is now available on Linux and macOS as well as Windows. (#11134)- On Linux, the persistent cache requires libsecret and
pygobject. If these are unavailable, or libsecret is unusable (e.g. in an SSH session), loading the persistent cache will raise an error. You may optionally configure the credential to fall back to an unencrypted cache by constructing it with keyword argumentallow_unencrypted_cache=True.
- On Linux, the persistent cache requires libsecret and
EnvironmentCredentialcorrectly initializesUsernamePasswordCredentialwith the value ofAZURE_TENANT_ID(#11127)- Values for the constructor keyword argument
authorityandAZURE_AUTHORITY_HOSTmay optionally specify an "https" scheme. For example, "https://login.microsoftonline.us" and "login.microsoftonline.us" are both valid. (#10819) - First preview of new API for authenticating users with
DeviceCodeCredentialandInteractiveBrowserCredential(#10612)- new method
authenticateinteractively authenticates a user, returns a serializableAuthenticationRecord - new constructor keyword arguments
authentication_recordenables initializing a credential with anAuthenticationRecordfrom a prior authenticationdisable_automatic_authentication=Trueconfigures the credential to raiseAuthenticationRequiredErrorwhen interactive authentication is necessary to acquire a token rather than immediately begin that authenticationenable_persistent_cache=Trueconfigures these credentials to use a persistent cache on supported platforms (in this release, Windows only). By default they cache in memory only.
- new method
- Now
DefaultAzureCredentialcan authenticate with the identity signed in to Visual Studio Code's Azure extension. (#10472)
- After an instance of
DefaultAzureCredentialsuccessfully authenticates, it uses the same authentication method for every subsequent token request. This makes subsequent requests more efficient, and prevents unexpected changes of authentication method. (#10349) - All
get_tokenmethods consistently require at least one scope argument, raising an error when none is passed. Althoughget_token()may sometimes have succeeded in prior versions, it couldn't do so consistently because its behavior was undefined, and dependened on the credential's type and internal state. (#10243) SharedTokenCacheCredentialraisesCredentialUnavailableErrorwhen the cache is available but contains ambiguous or insufficient information. This causesChainedTokenCredentialto correctly try the next credential in the chain. (#10631)- The host of the Active Directory endpoint credentials should use can be set
in the environment variable
AZURE_AUTHORITY_HOST. Seeazure.identity.KnownAuthoritiesfor a list of common values. (#8094)
ManagedIdentityCredentialraisesCredentialUnavailableErrorwhen no identity is configured for an IMDS endpoint. This causesChainedTokenCredentialto correctly try the next credential in the chain. (#10488)
DefaultAzureCredentialcan now authenticate using the identity logged in to the Azure CLI, unless explicitly disabled with a keyword argument:DefaultAzureCredential(exclude_cli_credential=True)(#10092)
- Correctly parse token expiration time on Windows App Service (#9393)
- Credentials raise
CredentialUnavailableErrorwhen they can't attempt to authenticate due to missing data or state (#9372) CertificateCredentialsupports password-protected private keys (#9434)
- All credential pipelines include
ProxyPolicy(#8945) - Async credentials are async context managers and have an async
closemethod (#9090)
- Constructing
DefaultAzureCredentialno longer raisesImportErroron Python 3.8 on Windows (8294) InteractiveBrowserCredentialraises when unable to open a web browser (8465)InteractiveBrowserCredentialprompts for account selection (8470)- The credentials composing
DefaultAzureCredentialare configurable by keyword arguments (8514) SharedTokenCacheCredentialaccepts an optionaltenant_idkeyword argument (8689)
ClientCertificateCredentialuses application and tenant IDs correctly (8315)InteractiveBrowserCredentialproperly caches tokens (8352)- Adopted msal 1.0.0 and msal-extensions 0.1.3 (8359)
- Async credentials now default to
aiohttpfor transport but the library does not require it as a dependency because the async API is optional. To use async credentials, please installaiohttpor see azure-core documentation for information about customizing the transport. - Renamed
ClientSecretCredentialparameter "secret" to "client_secret" - All credentials with
tenant_idandclient_idpositional parameters now accept them in that order - Changes to
InteractiveBrowserCredentialparameters- positional parameter
client_idis now an optional keyword argument. If no value is provided, the Azure CLI's client ID will be used. - Optional keyword argument
tenantrenamedtenant_id
- positional parameter
- Changes to
DeviceCodeCredential- optional positional parameter
prompt_callbackis now a keyword argument prompt_callback's third argument is now adatetimerepresenting the expiration time of the device code- optional keyword argument
tenantrenamedtenant_id
- optional positional parameter
- Changes to
ManagedIdentityCredential- now accepts no positional arguments, and only one keyword argument:
client_id - transport configuration is now done through keyword arguments as
described in
azure-coredocumentation
- now accepts no positional arguments, and only one keyword argument:
- Authenticating with a single sign-on shared with other Microsoft applications only requires a username when multiple users have signed in (#8095)
DefaultAzureCredentialaccepts anauthoritykeyword argument, enabling its use in national clouds (#8154)
- Adopted
msal_extensions0.1.2 - Constrained
msalrequirement to >=0.4.1, <1.0.0
AuthorizationCodeCredentialauthenticates with a previously obtained authorization code. See Azure Active Directory's authorization code documentation for more information about this authentication flow.- Multi-cloud support: client credentials accept the authority of an Azure Active
Directory authentication endpoint as an
authoritykeyword argument. Known authorities are defined inazure.identity.KnownAuthorities. The default authority is for Azure Public Cloud,login.microsoftonline.com(KnownAuthorities.AZURE_PUBLIC_CLOUD). An application running in Azure Government would useKnownAuthorities.AZURE_GOVERNMENTinstead:
from azure.identity import DefaultAzureCredential, KnownAuthorities credential = DefaultAzureCredential(authority=KnownAuthorities.AZURE_GOVERNMENT)
- Removed
client_secretparameter fromInteractiveBrowserCredential
UsernamePasswordCredentialcorrectly handles environment configuration with no tenant information (#7260)- user realm discovery requests are sent through credential pipelines (#7260)
SharedTokenCacheCredentialauthenticates with tokens stored in a local cache shared by Microsoft applications. This enables Azure SDK clients to authenticate silently after you've signed in to Visual Studio 2019, for example.DefaultAzureCredentialincludesSharedTokenCacheCredentialwhen the shared cache is available, and environment variableAZURE_USERNAMEis set. See the README for more information.
- New dependency:
msal-extensions0.1.1
- Removed
azure.core.Configurationfrom the public API in preparation for a revamped configuration API. Staticcreate_configmethods have been renamed_create_config, and will be removed in a future release.
- Adopted azure-core 1.0.0b2
- If you later want to revert to a version requiring azure-core 1.0.0b1,
of this or another Azure SDK library, you must explicitly install azure-core
1.0.0b1 as well. For example:
pip install azure-core==1.0.0b1 azure-identity==1.0.0b1
- If you later want to revert to a version requiring azure-core 1.0.0b1,
of this or another Azure SDK library, you must explicitly install azure-core
1.0.0b1 as well. For example:
- Adopted MSAL 0.4.1
- New dependency for Python 2.7: mock
- Added credentials for authenticating users:
DeviceCodeCredential,InteractiveBrowserCredential,UsernamePasswordCredential- async versions of these credentials will be added in a future release
Version 1.0.0b1 is the first preview of our efforts to create a user-friendly and Pythonic 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-python.
This release supports service principal and managed identity authentication. See the documentation for more details. User authentication will be added in an upcoming preview release.
This release supports only global Azure Active Directory tenants, i.e. those using the https://login.microsoftonline.com authentication endpoint.