- Bumped the minimum
@azure/msal-nodedependency to^5.1.5so installs no longer resolve older5.1.xversions that pull in the vulnerableuuid@8.3.0transitive dependency. #1512
- Fixed
AzureDeveloperCliCredentialto correctly parse error messages from Azure Developer CLI v1.23.7 and later, which previously caused raw JSON to surface in the credential error instead of the underlying error text. #38416 - Fixed
handleMsalErrorto preserve the original MSAL error viacauseonAuthenticationRequiredError, allowing callers to access.claimson the underlying error. #38722
- Reduced bundle size by optimizing imports from
@azure/msal-node, e.g. achieving a ~61kb reduction (from 851kb to 790kb) when importingClientCertificateCredential. #36942 - Updated
@azure/msal-nodeto^5.1.0and@azure/msal-browserto^5.5.0. #37836
- Upgraded
@azure/msal-nodefrom^3.5.0to^5.1.0and@azure/msal-browserfrom^4.2.0to^5.5.0following the MSAL Node v5 migration guide and the MSAL Browser v5 migration guide. #37685- Removed usage of deprecated
storeAuthStateInCookieoption in browser cache configuration - Replaced deprecated
createPublicClientApplication()withcreateStandardPublicClientApplication() - Updated
handleRedirectPromiseto use options object instead of string parameter - Replaced deprecated
tokenQueryParameterswithextraQueryParametersin MSAL node flows
- Removed usage of deprecated
- Renamed
enableAzureKubernetesTokenProxyinWorkloadIdentityCredentialOptionstoenableAzureProxy. #36728
- Fixed an issue where
AzureDeveloperCliCredentialerror messages included raw JSON output fromazd auth tokeninstead of clean, user-friendly messages. The credential now parses the JSON stderr output to extract and display only the error message. #37268 - Fixed an issue where
IdentityClientdoes not pass response in expected format for MSAL in empty response situations with additional logging. #36906
- Refactored and cleaned up
MsalClientOptionsto eliminate nested property duplication, replacedgetIdentityClientAuthorityHostwithgetAuthorityHost, and removed deprecatedisNodein favor ofisNodeLike. #36731
- Added Kubernetes token proxy support (identity binding mode) to
WorkloadIdentityCredential. When enabled via theenableAzureKubernetesTokenProxyoption, the credential redirects token requests to an AKS-provided proxy to work around Entra ID's limit on federated identity credentials per managed identity. This feature is opt-in and only available when usingWorkloadIdentityCredentialdirectly (not supported byDefaultAzureCredentialorManagedIdentityCredential). #36218
- When
AZURE_TOKEN_CREDENTIALSis set to onlyManagedIdentityCredential,DefaultAzureCredentialdoes not issue a probe request and performs retries with exponential backoff. #36047
- Fixed an issue where
ManagedIdentityCredentialwill make an additional probe request in thegetTokencall. #36047
- Added a new
requiredEnvVarsoption toDefaultAzureCredentialthat can accept a single environment variable or an array of environment variables. All specified variables must be set (and non-empty) before credential instantiation. If any variable is missing or empty, an error is thrown listing all missing variables. #35832 - Introduced a new
DefaultAzureCredentialEnvVarsunion type that represents the environment variables supported inDefaultAzureCredential. This type is used to specify the required environment variable(s) in the option bag forDefaultAzureCredentialviarequiredEnvVars. #35832
- Fixed an issue where
AzureDeveloperCliCredentialwould time out during token requests whenazdprompts for user interaction. This issue commonly occurred in environments where theAZD_DEBUGenvironment variable was set, causing the Azure Developer CLI to display additional prompts that interfered with automated token acquisition. #35637 - Fixed an issue where
VisualStudioCodeCredentialwill show interactive authentication when the plugin is set but the broker is not available. #35837
AzureCliCredential,AzurePowerShellCredential, andAzureDeveloperCliCredentialnow raiseCredentialUnavailableErrorwhenclaimsare provided togetToken, as these credentials do not support claims challenges. The error message includes instructions for handling claims authentication scenarios. #35493 & #35855
- Fixed an issue in which
AzurePowerShellCredentialcommand is not parsed correctly. #35469
- All the features shipped as part of 4.11.0-beta.1 will be GA with this version. The most important features include single credential selection in
DefaultAzureCredentialviaAZURE_TOKEN_CREDENTIALSenvironment variable, broker authentication support throughVisualStudioCodeCredential, and signed-in Windows account support inDefaultAzureCredential.
- Fixed deprecation warnings in
AzureCliCredentialandAzureDeveloperCliCredential. #34878 - Fixed an issue where
InteractiveBrowserCredentialdid not resolve correctly on Mac OS. #35406
VisualStudioCodeCredentialhas been restored and now supports broker authentication using the Azure account signed in via Visual Studio Code. The credential has been added toDefaultAzureCredential#35150DefaultAzureCredentialnow supports authentication with the currently signed-in Windows account when the@azure/identity-brokerpackage is installed and configured withuseIdentityPlugin. This auth mechanism is added at the end of theDefaultAzureCredentialcredential chain. #35213- Added support for more
AZURE_TOKEN_CREDENTIALSenvironment variable values to specify a single credential type to use inDefaultAzureCredential. In addition todevandprod, possible values now includeVisualStudioCodeCredential,EnvironmentCredential,WorkloadIdentityCredential,ManagedIdentityCredential,AzureDeveloperCliCredential,AzurePowershellCredentialandAzureCliCredential- each for the corresponding credential type. #34966
- Added HTTP 410 status code handling to
ManagedIdentityCredentialretry policy with minimum 70-second total retry duration to meet Azure IMDS service requirements. #34981
- Fixed an issue in
AzurePowerShellCredentialwhere-AsPlainTextis not supported in theConvertFrom-SecureStringcmdlet in older versions. #34902
- Added support to specify
subscriptionID or name onAzureCliCredentialerror message. #34801
- Fixed the bug in interactive authentication request to account for the correct user login prompt based on the login hint provided, in case there are multiple accounts present in the browser flow. #34321
- Fixed the typing for
WorkloadIdentityCredential.getTokento better represent the runtime behavior. #34786
- Added support for the
AZURE_TOKEN_CREDENTIALSenvironment variable toDefaultAzureCredential, which allows for choosing between 'deployed service' and 'developer tools' credentials. Valid values are 'dev' for developer tools and 'prod' for deployed service. #34301
- Added deprecation warnings for username password usage in
EnvironmentCredentialconstructor to warn the users.UsernamePasswordauthentication doesn't support Multi-Factor Authentication (MFA), and MFA will enabled soon on all tenants. For more details, see Planning for mandatory MFA. #34054
- Update the order for conditional exports so that the most specific conditions are listed first. #33914
- Fix a bug in which
self.locationis undefined in specific environment. #33914
- Add
workerdconditional exports support for Cloudflare environment. #32422
- Marked
VisualStudioCodeCredential,VisualStudioCodeCredentialOptionsandVSCodeCredentialFinderas deprecated. #33413 - Upgraded version of
@azure/msal-nodeto v3.5.0 that has a bug fix for Azure Machine Learning Managed Identity. #33792
ManagedIdentityCredentialwill now log the configured user-assigned managed identity ID. #33144
- Deprecated
UsernamePasswordCredentialandUsernamePasswordCredentialOptions, as the credential doesn't support multifactor authentication (MFA). MFA will soon be enforced on all Microsoft Entra tenants. For more details, see Planning for mandatory MFA. #33136 and #33312 - For
AzureCliCredentialandAzureDeveloperCliCredential, if system root environment variable is not found on the Windows platform, the system root variable is set to the appropriate value with a warning logged as opposed to throwing an error. #33178
- Added
subscriptionproperty inAzureCliCredentialOptions. #31451
- Fixed the logic to return authority without the scheme and tenant ID #31540
- Fixed an issue where an incorrect tenant ID was presented in multi-tenant authentication errors #32505
ManagedIdentityCredentialnow throws an error when attempting to pass a user-assigned Managed Identity in a ServiceFabric environment instead of silently ignoring it. #32841- Fixed the bug in silent authentication behavior to happen only in scenarios where an account is present either in the persistent cache (if tokenCachePersistence is enabled and authentication record is provided) or the in-memory cache, instead of silently picking up the first account found in token cache. #32134
- Fixed the bug in interactive authentication request to account for the correct user login prompt based on the login hint provided, in case there are multiple accounts present. #32134
- Incorporated the fix by @azure/msal-node (v 3.2.1) for silent authentication to do token lookup in persistent cache.
- Mark
AzureAuthorityHosts.AZURE_GERMANYdeprecated as the Germany cloud closed in 2021. #31519 - Native ESM support has been added, and this package will now emit both CommonJS and ESM. #31647
- Update
@azure/msal-browserto 4.x #32565
- Added Proof-of-Possession via Signed HTTP Request (SHR) support to
AccessTokenandGetTokenOptionsfor native broker scenarios inInteractiveBrowserCredentialto be used with plugin@azure/identity-broker#30961.
- Fixed the request sent in AzurePipelinesCredential so it doesn't result in a redirect response when an invalid system access token is provided #31209.
- Allow certain response headers to be logged in
AzurePipelinesCredentialfor diagnostics and include them in the error message #31209
- Added support for the field
refreshAfterTimestampinAccessToken#30402 - Added support for providing an object ID to
ManagedIdentityCredential. #30771 - Added support for token cache persistence via the
CredentialTokenPersistenceoptions to theClientAssertionCredential. #31129
ManagedIdentityCredentialnow throws an error when attempting to pass a user-assigned Managed Identity in a CloudShell environment instead of silently ignoring it. #30955- Fixed an issue where cross-tenant federation did not read the AZURE_AUTHORITY_HOST environment in all scenarios. #31134
- Added support in
EnvironmentCredentialandDefaultAzureCredentialforAZURE_CLIENT_SEND_CERTIFICATE_CHAINenvironment variable to configure subject name / issuer authentication. #30570 - Added support for
AsSecureStringinAzurePowerShellCredential. #30720
- Fixed an issue where an incorrect error message was returned when the service responds with a 400 status code. #30532
- Improved error messages for credential parameter validation. #30610
- ManagedIdentityCredential errors will now include the underlying error cause under the
causeproperty. #30532
- Improved error messages for
AzurePipelinesCredentialfor Authentication Failed scenarios. #30387 - Improved token parsing for
AzurePowerShellCredentialeven with warning messages. #30508
ManagedIdentityCredentialmigrated to use MSAL for handling the majority of the managed identity implementation. #30172
ManagedIdentityCredentialmigrated to use MSAL for handling the majority of the managed identity implementation. #30172
OnBehalfOfCredentialnow supports taking clientAssertion callbackgetAssertion. #29711
- Fixed an issue where cross-tenant federation did not honor the request's tenant ID. #30266
OnBehalfOfCredentialmigrated to use MSALClient internally instead of MSALNode flow. This is an internal refactoring and should not result in any behavioral changes. #29890InteractiveBrowserCredentialmigrated to use MSALClient internally instead of MSALNode flow in Node. This is an internal refactoring and should not result in any behavioral changes. #29894
- Added
AzurePipelinesCredentialfor supporting workload identity federation in Azure Pipelines with service connections.
- Managed identity bug fixes
- Managed identity bug fixes
- Introducing a new credential
AzurePipelinesCredentialfor supporting workload identity federation in Azure Pipelines with service connections. #29392
ClientSecretCredential,ClientCertificateCredential, andClientAssertionCredentialno longer try silent authentication unnecessarily as per the MSAL guidelines. For more information please refer to the Entra documentation on token caching. #29405
DeviceCodeCredentialmigrated to use MSALClient internally instead of MSALNode flow. This is an internal refactoring and should not result in any behavioral changes. #29405UsernamePasswordCredentialmigrated to use MSALClient internally instead of MSALNode flow. This is an internal refactoring and should not result in any behavioral changes. #29656AuthorizationCodeCredentialmigrated to use MSALClient internally instead of MSALNode flow. This is an internal refactoring and should not result in any behavioral changes. #29831
- Adds support for
getBearerTokenProviderthat returns a callback function to get a token for a given scope. This is useful for scenarios where an explicit Entra token is needed without having to worry about the token refreshing details.
ClientSecretCredential,ClientCertificateCredential, andClientAssertionCredentialmigrated to use MSALClient internally instead of MSALNode flow. This is an internal refactoring and should not result in any behavioral changes. #28873
InteractiveBrowserCredential: Added support for using the default broker account. #28979.
- IMDS probing retry configuration updated for
DefaultAzureCredentialandManagedIdentityCredential, withmaxRetryCountincreased to 5. For more information, see BREAKING_CHANGES.md.
- msal cache files are properly named when the user does not pass in a custom file name #29039
- Allow IMDS probing retry options in
ManagedIdentityCredentialandDefaultAzureCredentialto be overridden by customers.
AzureCliCredential: Added support for the new response field which represents token expiration timestamp as time zone agnostic value. (#28333)
new DefaultAzureCredential()will no longer throw when one of the credentials in the chain fails to instantiate. Any creation errors will be logged whengetTokenis called. #28264
- Initialize Public Client Application in the Interactive Browser Credential, as required by @azure/msal-browser v3 fixed in #28292.
- Fixed regressions introduced by 3.4.0 #27761
- All the features shipped as part of 4.0.0-beta.1 will be GA with this version. The most important features being the browser customization for success/ error messages and the support of brokered authentication on Windows OS, such as WAM.
- Starting with v4.0.0 of
@azure/identity, Node.js v20 will be supported and Node.js v16 will no longer be supported.
- Upgraded version of @azure/msal-node to v2.5.0 to support all versions of Node.js - Node 16, Node 18 and Node 20.
- Added
brokerOptionsinInteractiveBrowserCredentialfor authentication broker support such as WAM. This feature works along with the new@azure/identity-brokerplugin package. Note that this feature is only available in node. - Added support for MSA passthrough in the
brokerOptionsofInteractiveBrowserCredential. Note this is only available for legacy 1st party applications. - Added
BrowserCustomizationOptionsfor success and error messages in theInteractiveBrowserCredential.
- The
redirectUriis no longer a required option forInteractiveBrowserCredentialon Node.js. There's no API change, but this is a behavior change.
- Ensure
AzurePowershellCredentialcalls PowerShell with the-NoProfileand "-NonInteractive" flag to avoid loading user profiles for more consistent behavior. (#27023) - Fixed browser bundling for Azure Developer CLI credential. ([Identity] update mapping for browser for azd (#27097))
ManagedIdentityCredentialwill 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.(#27050)
- The default IMDS probe request timeout in
ManagedIdentityCredentialhas been increased to 1 second from 0.3 seconds to reduce the likelihood of false negatives. - Fixed links to documentation.
- Further improvements to tenant and scope validation.
- Bug fixes for developer credentials
- Enabled support for logging personally identifiable information, required for customer support through the
enableUnsafeSupportLoggingoption onloggingOptionsunderTokenCredentialOptions. - Continuous Access Evaluation (CAE) is now configurable per-request by setting the
enable_caekeyword argument toTrueinget_token. This applies to user credentials and service principal credentials. (#26614)
- CP1 client capabilities for CAE is no longer always-on by default for user credentials. This capability will now be configured as-needed in each
getTokenrequest by each SDK. (#26614)- Suffixes are now appended to persistent cache names to indicate whether CAE or non-CAE tokens are stored in the cache. This is to prevent CAE and non-CAE tokens from being mixed/overwritten in the same cache. This could potentially cause issues if you are trying to share the same cache between applications that are using different versions of the Azure Identity library as each application would be reading from a different cache file.
- Since CAE is no longer always enabled for user-credentials, the
AZURE_IDENTITY_DISABLE_CP1environment variable is no longer supported.
- Fixed a bug related to Managed Identity Credential intermixing wrong scopes for successive
getToken()calls.
- Dependency Upgrades of MSAL libraries to the latest versions for incorporating underlying bug fix to resolve this issue.
- Moved
AzureDeveloperCliCredentialto the end of theDefaultAzureCredentialchain.
- Remove console logging in
processMultitenantRequestfor tenant id and resolved tenant.
- Fixed a bug in
WorkloadIdentity Credential, to incorporate the case where the options can beundefinedin a conditional check. Related issue #25827 with the fix #25829.
- Renamed
developerCredentialTimeOutInMstoprocessTimeoutInMsinDefaultAzureCredentialOptions. - Renamed
federatedTokenFilePathtotokenFilePathunderWorkloadIdentityOptions.
- Added configurable process timeout for dev-time credentials -
AzureCLI Credential,AzurePowershell CredentialandAzureDeveloperCLI Credential.
- Fixed a bug in
WorkloadIdentity Credential, to incorporate the case where the options can beundefinedin a conditional check. Related issue #25089 with the fix #25119. - Exported
WorkloadIdentityDefaultCredentialOptionswhich was previously not publicly exported inindex.ts.
- Added a workaround of fetching all accounts from token cache to fix the issue of silent authentication not taking place when authenticationRecord is passed. For reference, see issue.
- Added support to disable instance discovery on Microsoft Entra credentials.
- Added
AzureDeveloperCliCredential#24180 and added it to theDefaultAzureCredential#24826 auth flow - Added support for
WokloadIdentityCredential#24830, added it toDefaultAzureCredentialauth flow and replaced the in-house implementation ofToken Exchange MSIinManagedIdentitywithWorkloadIdentityCredential.
- Upgraded versions of @azure/msal-node, @azure/msal-common and @azure/msal-browser to remove any dependency versions that were depending on old version of jsonwebtoken which had a security issue
- Fixed bug in
ManagedIdentity Credentialwhere "expiresInSeconds" was taking the absolute timestamp instead of relative expiration time period in seconds.
- Enable msal logging based on log level specified by user for Azure SDK.
- Upgraded version dependencies on msal libraries, since they have additional logging added.
- Fixed bug to update "expiresOnTimestamp" field in Managed Identity to be in seconds and not milliseconds.
- Docs improvements for cross-language alignment
- Fixed bug to enable
additionallyAllowedTenantsto pass through to MSAL Flow.
- Added Token Caching support to Managed Identity Credential
- Added
additionallyAllowedTenantsto the following credential options to force explicit opt-in behavior for multi-tenant authentication via the options property bag to the following:AuthorizationCodeCredentialOptionsAzureApplicationCredentialOptionsAzureCliCredentialOptionsAzurePowerShellCredentialOptionsClientAssertionCredentialOptionsClientCertificateCredentialOptionsClientSecretCredentialOptionsDefaultAzureCredentialOptionsDeviceCodeCredentialOptionsEnvironmentCredentialOptionsInteractiveCredentialOptionsOnBehalfOfCredentialOptionsUsernamePasswordCredentialOptionsVisualStudioCodeCredentialOptions
- Credential types supporting multi-tenant authentication will now throw an error if the requested tenant ID doesn't match the credential's tenant ID, and is not included in the
additionallyAllowedTenantsoption. Applications must now explicitly add additional tenants to theadditionallyAllowedTenantslist, or add"*"to list, to enable acquiring tokens from tenants other than the originally specified tenant ID. See BREAKING_CHANGES.md.
- Changed the way token expiration for managed identity tokens is calculated to handle different server formats. See PR #23232
- Added support in
EnvironmentCredentialto read a certificate password from an environment variableAZURE_CLIENT_CERTIFICATE_PASSWORD - Added samples for supporting Microsoft Entra authentication in Azure Redis Cache
- Removed
VisualStudioCodeCredentialfromDefaultAzureCredentialtoken chain. Issue 20500 tracks this.
- Added support for new credential
ClientAssertionCredential, which accepts a callback function for the signed JWT assertion for a client certificate. See MSAL Client Assertion for more information.
- Fixed a bug that would break the AzureCliCredential if the Azure CLI reported a warning. See: 21075.
- Fixed a bug in
AuthorizationCodeCredentialwhere the tenant id was not being used. Thecommontenant was the only tenant being used by this credential. - Fixed a bug in
AuthorizationCodeCredentialwhere the public client was not being used. Due to this bug, without passing in the client secret, this credential would fail. - Fixed a bug in
DefaultAzureCredentialandAzureCLICredentialwhere the errors thrown by the latter credential were not of typeCredentialUnavailableError. This caused only the error ofAzureCLICredentialbeing thrown and the other chained errors ofDefaultAzureCredentialwere not thrown. See: 22066
- Upgraded to
@azure/core-tracingversion^1.0.0. - Improved the errors displayed on the
AzureCliCredential.
- Fixed a bug in
InteractiveBrowserCredentialfor Mac OS where the app was not getting closed after the authorization succeeded.
- Added stronger types to the
DefaultAzureCredentialandManagedIdentityCredentialconstructors so that TypeScript users will trigger a type error by providing both a Managed Identity client ID and resource ID to the same credential instance. - Added stronger types to the
ClientCertificateCredentialandOnBehalfOfCredentialconstructors so that TypeScript users will trigger a type error by providing both a Client certificate and certificate path to the same credential instance. - Added support for App Service 2019 resource in Managed Identity Credential.
- All of our credentials now support a new option on their constructor:
loggingOptions, which allows configuring the logging options of the HTTP pipelines. - Within the new
loggingOptionswe have also addedallowLoggingAccountIdentifiers, a property that if set to true logs information specific to the authenticated account after each successful authentication, including: the Client ID, the Tenant ID, the Object ID of the authenticated user, and if possible the User Principal Name.
- Fixed a bug that caused Continuous Access Enforcement (CAE) and Conditional Access authentication context authentication to fail with newer versions of MSAL.
- Added support for specifying a custom
resourceIdwhen creating aManagedIdentityCredentialorDefaultAzureCredential.- In some scenarios where a user-assigned managed identity is required, the identity may be known by an ARM resource ID, but not a client ID (such as when user-assigned identities are created using an ARM template). The
resourceIdoption allows an app to select its managed identity by its ARM resource ID to support such scenarios. - If
resourceIdis provided, the managed identity providers for Azure App Service (2017), Azure Arc, Azure Cloud Shell, Azure Service Fabric and Token Exchange authentication will log a warning since this parameter is not supported by the identity endpoints in those services. The authentication attempts will be sent, but the parameter will be ignored by the service.
- In some scenarios where a user-assigned managed identity is required, the identity may be known by an ARM resource ID, but not a client ID (such as when user-assigned identities are created using an ARM template). The
- Added
clientIdto the optional parameters of theManagedIdentityCredential. - Updated the Troubleshoot guide to have error codes and error messages for the Identity Customer Service Support.
- Fixed a regression in version 2.0.3 in which providing an options bag, but not a client ID, to the
ManagedIdentityCredentialconstructor would discard theoptionsparameter.
- Added log warning for non-support of user assigned identity in Managed Identity credentials in Cloud Shell environments.
- Fixed bug that duplicated the tenant Id on the URI of outgoing requests when passing an
authorityHostending with a tenant Id. ManagedIdentityCredentialnow won't retry when it tries to ping the IMDS endpoint.- Now we are specifying the maximum number of retries to 3 to ensure that maximum retries won't change without notice.
- Improved the error message when
InteractiveBrowserCredentialis used with an unavailable port (such as when noredirectUriis provided, and the port80is busy) and when no browser is available.
- Challenge claims now are properly being passed through to the outgoing token requests.
- The
ManagedIdentityCredentialnow properly parses expiration dates from token exchange requests.
- Moved the
@types/stoppabledependency to thedevDependencies.
- The
ManagedIdentityCredentialnow supports the Service Fabric environment.
- Fixed a bug that caused the
AzureCliCredentialto fail on Windows. Issue 18268.
After multiple beta releases over the past year, we're proud to announce the general availability of version 2 of the @azure/identity package. This version includes the best parts of v1, plus several improvements.
This changelog entry showcases the changes that have been made from version 1 of this package. See the v1-to-v2 migration guide for details on how to upgrade your application to use the version 2 of @azure/identity. For information on troubleshooting the Identity package, see the troubleshooting guide.
Identity v2 provides a top-level useIdentityPlugin function, which allows using two new plugin packages:
- @azure/identity-vscode, which provides the dependencies of
VisualStudioCodeCredentialand enables it.- If the
@azure/identity-vscodeplugin isn't used through theuseIdentityPluginfunction, theVisualStudioCodeCredentialexposed by Identity v2 will throw aCredentialUnavailableError.
- If the
- @azure/identity-cache-persistence, which provides persistent token caching.
Most credentials on Identity v2 now support the persistent token caching feature. Such credentials include the property tokenCachePersistenceOptions in the constructor options which can be used to enable this feature.
The following example showcases how to enable persistence caching by first enabling the @azure/identity-cache-persistence plugin with useIdentityPlugin(cachePersistencePlugin), and then passing the tokenCachePersistenceOptions through the constructor of the DeviceCodeCredential:
import { cachePersistencePlugin } from "@azure/identity-cache-persistence";
import { useIdentityPlugin, DeviceCodeCredential } from "@azure/identity";
useIdentityPlugin(cachePersistencePlugin);
async function main() {
const credential = new DeviceCodeCredential({
tokenCachePersistenceOptions: {
enabled: true,
},
});
}Identity v2 includes two new credential types:
AzurePowerShellCredential, which re-uses any account previously authenticated with theAz.AccountPowerShell module.OnBehalfOfCredential, which enables the On-Behalf-Of authentication flow.
Identity v2 enables:
- Support for claims challenges resulting from Continuous Access Enforcement (CAE) and Conditional Access authentication context.
- By default, credentials of Identity v2 will produce tokens that can be used to trigger the challenge authentication flows. After these tokens expire, the next HTTP requests to Azure will fail, but the response will contain information to re-authenticate.
- To disable this behavior, set the environment variable
AZURE_IDENTITY_DISABLE_CP1to any value. For more about claims challenges, see Claims challenges, claims requests, and client capabilities.
- Support for multi-tenant authentication on all credentials except
ManagedIdentityCredential.- At the moment, applications needing multi-tenancy support will need to call to the credentials'
getTokendirectly, sending the newtenantIdproperty. - A sample with more context will be provided in a future date.
- To disable it, set the environment variable
AZURE_IDENTITY_DISABLE_MULTITENANTAUTH. For more about multitenancy, see Identity management in multitenant apps.
- At the moment, applications needing multi-tenancy support will need to call to the credentials'
You can now control when the credential requests user input with the new disableAutomaticAuthentication option added to the options you pass to the credential constructors.
- When enabled, this option stops the
getToken()method from requesting user input in case the credential is unable to authenticate silently. - If
getToken()fails to authenticate without user interaction, anddisableAutomaticAuthenticationhas been set to true, a new error will be thrown:AuthenticationRequired. You may use this error to identify scenarios when manual authentication needs to be triggered (withauthenticate(), as described in the next point).
A new method authenticate() is added to these credentials which is similar to getToken(), but it does not read the disableAutomaticAuthentication option described above.
- Use this to get an
AuthenticationRecordwhich you can then use to create new credentials that will re-use the token information. - The
AuthenticationRecordobject has aserialize()method that allows an authenticated account to be stored as a string and re-used in another credential at any time. Use the new helper functiondeserializeAuthenticationRecordto de-serialize this string. authenticate()might succeed and still returnundefinedif we're unable to pick just one account record from the cache. This might happen if the cache is being used by more than one credential, or if multiple users have authenticated using the same Client ID and Tenant ID. To ensure consistency on a program with many users, please keep track of theAuthenticationRecordand provide them in the constructors of the credentials on initialization.
Learn more via the below samples
In Identity v2, the ManagedIdentityCredential retries with exponential back-off when a request for a token fails with a 404 status code. This change only applies to environments with available IMDS endpoints.
Azure Service Fabric support hasn't been added on the initial version 2 of Identity. Subscribe to issue #12420 for updates on this feature.
ClientCertificateCredentialnow optionally accepts a configuration object as its third constructor parameter, instead of the PEM certificate path. This new object, calledClientCertificateCredentialPEMConfiguration, can contain either the PEM certificate path with thecertificatePathproperty, or the contents of the PEM certificate with thecertificateproperty..- The Node.js version of
InteractiveBrowserCredentialhas Proof Key for Code Exchange (PKCE) enabled by default. InteractiveBrowserCredentialhas a newloginHintconstructor option, which allows a username to be pre-selected for interactive logins.- In
AzureCliCredential, we allow specifying atenantIdin the parameters through theAzureCliCredentialOptions. - A new error, named
AuthenticationRequiredError, has been added. This error shows up when a credential fails to authenticate silently. - Errors and logged exceptions may point to the new troubleshooting guidelines.
- On all of the credentials we're providing, the initial authentication attempt in the lifetime of your app will include an additional request to first discover relevant endpoint metadata information from Azure.
-
For
ClientCertificateCredentialspecifically, the validity of the PEM certificate is evaluated ongetTokenand not on the constructor. -
We have also renamed the error
CredentialUnavailabletoCredentialUnavailableError, to align with the naming convention used for error classes in the Azure SDKs in JavaScript. -
In v1 of Identity some
getTokencalls could resolve withnullin the case the authentication request succeeded with a malformed output. In v2, issues with thegetTokenmethod will always throw errors. -
Breaking changes to InteractiveBrowserCredential
- The
InteractiveBrowserCredentialwill use the Auth Code Flow with PKCE rather than Implicit Grant Flow to better support browsers with enhanced security restrictions. Learn how to migrate in the migration guide. Read more about the latestInteractiveBrowserCredentialhere. - The default client ID used for
InteractiveBrowserCredentialwas viable only in Node.js and not for the browser. Therefore, on v2 client ID is a required parameter when using this credential in browser apps. - Identity v2 also removes the
postLogoutRedirectUrifrom the options to the constructor forInteractiveBrowserCredential. This option wasn't being used. Instead of using this option, use MSAL directly. For more information, see Authenticating with the @azure/msal-browser Public Client. - In Identity v2,
VisualStudioCodeCredentialthrows aCredentialUnavailableErrorunless the new @azure/identity-vscode plugin is used.
- The
-
Standardizing the tracing span names to be
<className>.<operationName>over<className>-<operationName>
- Removed the
allowMultiTenantAuthenticationoption from all of the credentials. Multi-tenant authentication is now enabled by default. On Node.js, it can be disabled with theAZURE_IDENTITY_DISABLE_MULTITENANTAUTHenvironment variable. - Removed support for specific Azure regions on
ClientSecretCredentialand `ClientCertificateCredential. This feature will be added back on the next beta.
- Stopped exporting the
ApplicationCredentialfrom the package. This will be re-introduced in the future. - Removed the
CredentialPersistenceOptionsfromDefaultAzureCredentialandEnvironmentCredential. - Merged the configuration and the options bag on the
OnBehalfOfCredentialinto a single options bag. AuthenticationRequiredError(introduced in 2.0.0-beta.1) now has its parameters into a single options bag.AuthenticationRequiredError(introduced in 2.0.0-beta.1) now has its parameters in a single options bag,AuthenticationRequiredErrorOptions.InteractiveBrowserCredentialOptionshas been renamed toInteractiveBrowserCredentialNodeOptions, andInteractiveBrowserCredentialBrowserOptionshas been namedInteractiveBrowserCredentialInBrowserOptions.
ClientSecretCredential,ClientCertificateCredential, andUsernamePasswordCredentialthrow if the required parameters aren't provided (even in JavaScript).- Fixed a bug that caused
AzureCliCredentialto fail when a custom tenant ID was provided. - Caught up with the bug fixes for Azure POD Identity that were implemented on version 1.5.1.
Identity v2 no longer includes native dependencies (neither ordinary, peer, nor optional dependencies). Previous distributions of @azure/identity included an optional dependency on keytar, which caused issues for some users in restrictive environments.
Identity v2 for JavaScript now also depends on the latest available versions of @azure/msal-common, @azure/msal-node, and @azure/msal-browser. Our goal is to always be up-to-date with the MSAL versions.
- Added the
OnBehalfOfCredential, which allows users to authenticate through the On-Behalf-Of authentication flow. ManagedIdentityCredentialnow supports token exchange authentication.
ClientCertificateCredentialnow evaluates the validity of the PEM certificate path ongetTokenand not on the constructor.
- The property named
selectedCredentialthat was added toChainedTokenCredentialandDefaultAzureCredentialhas been removed, since customers reported that logging was enough. - Changed the name of the "extension" API to the "plugin" API to reduce confusion between this package and VS Code extensions. The function
useIdentityExtensionwas renamed touseIdentityPlugin, and "extension packages" are now known as "plugin packages". - Renamed the
allowUnencryptedStorageproperty ofTokenCachePersistenceOptionstounsafeAllowUnencryptedStorageto make it clear that enabling the unencrypted storage feature is not generally safe for production use.
ClientSecretCredential,ClientCertificateCredentialandUsernamePasswordCredentialnow throw if the required parameters are not provided (even in JavaScript).- Fixed a bug introduced on 2.0.0-beta.5 that caused the
ManagedIdentityCredentialto fail authenticating in Arc environments. Since our new core disables unsafe requests by default, we had to change the security settings for the first request of the Arc MSI, which retrieves the file path where the authentication value is stored since this request generally happens through an HTTP endpoint. - Fixed bug on the
AggregateAuthenticationError, which caused an inconsistent error message on theChainedTokenCredential,DefaultAzureCredentialandApplicationCredential.
- The errors thrown by the
ManagedIdentityCredentialhave been improved.
- Fixed a bug introduced on 1.5.0 that caused the
ManagedIdentityCredentialto fail authenticating in Arc environments. Since our new core disables unsafe requests by default, we had to change the security settings for the first request of the Arc MSI, which retrieves the file path where the authentication value is stored since this request generally happens through an HTTP endpoint.
- Fixed how we verify the IMDS endpoint is available. Now, besides skipping the
Metadataheader, we skip the URL query. Both will ensure that all the known IMDS endpoints return as early as possible. - Added support for the
AZURE_POD_IDENTITY_AUTHORITY_HOSTenvironment variable. If present, the IMDS endpoint initial verification will be skipped.
- This release adds support by default for CP1 client capabilities, enabling all credentials to respond to claims challenges that occur due to insufficient claims. Claims challenges, for example, can occur due to requirements of Continuous Access Enforcement (CAE) and Conditional Access authentication context. You may optionally disable this behavior by setting the environment variable
AZURE_IDENTITY_DISABLE_CP1(to any value). You can read more about client capabilities, CAE, and Conditional Access on the Microsoft Documentation. ChainedTokenCredentialandDefaultAzureCredentialnow expose a property namedselectedCredential, which will store the selected credential once any of the available credentials succeeds.- Implementation of
ApplicationCredentialfor use by applications which call into Microsoft Graph APIs and which have issues usingDefaultAzureCredential. This credential is based onEnvironmentCredentialandManagedIdentityCredential.
These changes do not impact the API of stable versions such as 1.6.0. Only code written against a beta version such as 1.7.0b1 may be affected.
- Renamed
AZURE_POD_IDENTITY_TOKEN_URLtoAZURE_POD_IDENTITY_AUTHORITY_HOST.
- With this release, we've migrated from using
@azure/core-httpto@azure/core-rest-pipelinefor the handling of HTTP requests. See Azure Core v1 vs v2 for more on the difference and benefits of the move. This removes our dependency onnode-fetchand along with it issues we have seen in using this dependency in specific environments like Kubernetes pods.
- With this release, we've migrated from using
@azure/core-httpto@azure/core-rest-pipelinefor the handling of HTTP requests. See Azure Core v1 vs v2 for more on the difference and benefits of the move. This removes our dependency onnode-fetchand along with it issues we have seen in using this dependency in specific environments like Kubernetes pods.
-
With this release, we drop support for Node.js versions that have reached the end of life, like Node.js 8. Read our support policy for more details.
-
Updated the default timeout of the first request of the IMDS MSI from half a second to three seconds to compensate for the slowness caused by
node-fetchfor initial requests in specific environments, like Kubernetes pods. -
Upgraded
@azure/core-httpto version^2.0.0, and@azure/core-tracingto version1.0.0-preview.12. -
Upgraded the
AuthorizationCodeCredentialto use the latest@azure/msal-node.
- With the dropping of support for Node.js versions that are no longer in LTS, the dependency on
@types/nodehas been updated to version 12. Read our support policy for more details. - Introduced an extension API through a top-level method
useIdentityExtension. The function accepts an "extension" as an argument, which is a function accepting acontext. The extension context is an internal part of the Azure Identity API, so it has anunknowntype. Two new packages are designed to be used with this API:@azure/identity-vscode, which provides the dependencies ofVisualStudioCodeCredentialand enables it (see more below).@azure/identity-cache-persistence, which provides persistent token caching (same as was available in version 2.0.0-beta.2, but now provided through a secondary extension package).
- Reintroduced a stub implementation of
VisualStudioCodeCredential. If the@azure/identity-vscodeextension is not used, then it will throw aCredentialUnavailableError(similar to how it previously behaved if thekeytarpackage was not installed). The extension now provides the underlying implementation ofVisualStudioCodeCredentialthrough dependency injection. - Reintroduced the
TokenCachePersistenceOptionsproperty on most credential constructor options. This property must be present with anenabledproperty set to true to enable persistent token caching for a credential instance. Credentials that do not support persistent token caching do not have this property. - Added support to
ManagedIdentityCredentialfor Bridge to Kubernetes local development authentication. - Enabled PKCE on
InteractiveBrowserCredentialfor Node.js. Proof Key for Code Exchange (PKCE) is a security feature that mitigates authentication code interception attacks. - Added
LoginHintproperty toInteractiveBrowserCredentialOptionswhich 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. - Added regional STS support to client credential types.
- Added the
RegionalAuthoritytype, that allows specifying Azure regions. - Added
regionalAuthorityproperty toClientSecretCredentialOptionsandClientCertificateCredentialOptions. - If instead of a region,
AutoDiscoverRegionis specified as the value forregionalAuthority, MSAL will be used to attempt to discover the region. - A region can also be specified through the
AZURE_REGIONAL_AUTHORITY_NAMEenvironment variable.
- Added the
AzureCliCredentialandAzurePowerShellCredentialnow allow specifying atenantId.- All credentials except
ManagedIdentityCredentialsupport enabling multi tenant authentication via theallowMultiTenantAuthenticationoption.
- Removed the protected method
getAzureCliAccessTokenfrom the public API of theAzureCliCredential. While it will continue to be available as part of v1, we won't be supporting this method as part of v2's public API.
- Fixed an issue in which
InteractiveBrowserCredentialon Node would sometimes cause the process to not respond if there was no browser available. - Fixed an issue in which the
AZURE_AUTHORITY_HOSTenvironment variable was not properly picked up in Node.js.
- Azure Identity for JavaScript no longer carries any native dependencies (neither ordinary, peer, nor optional dependencies). Previous distributions of
@azure/identitycarried an optional dependency onkeytar, which caused issues for some users in restrictive environments. - Updated the
@azure/msal-nodedependency to version^1.0.2, which allows cancelling of an ongoinggetToken()operation onDeviceCodeCredential. - Fixed issue with the logging of success messages on the
DefaultAzureCredentialand theChainedTokenCredential. These messages will now mention the internal credential that succeeded. AuthenticationRequiredError(introduced in 2.0.0-beta.1) now has the same impact onChainedTokenCredentialas theCredentialUnavailableErrorwhich is to allow the next credential in the chain to be tried.ManagedIdentityCredentialnow retries with exponential back-off when a request for a token fails with a 404 status code on environments with available IMDS endpoints.- Added an
AzurePowerShellCredentialwhich will use the authenticated user session from theAz.AccountPowerShell module. This credential will attempt to use PowerShell Core by callingpwsh, and on Windows it will fall back to Windows PowerShell (powershell) if PowerShell Core is not available.
- Removed
VisualStudioCodeCredential, since it requires us to list keytar as an optional dependency.keytarcontains machine-code components that are difficult to build in certain environments, so this credential will be offered through a separate extension package in the future. - Removed token persistence through
@azure/msal-node-extensions, as its machine-code components have the same problems askeytar. This functionality will similarly be reintroduced through a separate extension package in the future. - Removed
authenticationRecord,disableAutomaticAuthenticationandauthenticate()from the credentialUsernamePasswordCredential. While MSAL does support this, allowingauthenticationRecordarguably could result in users authenticating through an account other than the one they're specifying with the username and the password.
- Breaking change: Renamed errors
CredentialUnavailabletoCredentialUnavailableError, andAuthenticationRequiredtoAuthenticationRequiredError, to align with the naming convention used for error classes in the Azure SDKs in JavaScript. - Added
clientIdto theAuthenticationRecordtype, alongsides thetenantIdthat this interface already had. Together they can be used to re-authenticate after recovering a previously serializedAuthenticationRecord. - The
serialize()method on theAuthenticationRecordobject that allows an authenticated account to be stored as a string and re-used in another credential at any time, is removed in favor of a standalone functionserializeAuthenticationRecordsimilar to how we have thedeserializeAuthenticationRecordfunction. serializeAuthenticationRecordnow serializes into a JSON string with camel case properties. This makes it re-usable across languages.- Removed the interface
PersistentCredentialOptions(introduced in2.0.0-beta.1) and instead inlined the options for the persistent cache feature in the options of individual credentials. - Added properties
scopesandgetTokenOptionsto the AuthenticationRequired error. These properties hold the values used by thegetToken()method on your credential to fetch the access token. You should pass these to theauthenticate()method on your credential if you wanted to do manual authentication after catching theAuthenticationRequirederror. InteractiveBrowserCredentialno longer supports Implicit Grant Flow and will only support Auth Code Flow instead. Therefore theflowoption introduced in1.2.4-beta.1has been removed. More information from the documentation on Implicit Grant Flow:
With the plans for third party cookies to be removed from browsers, the implicit grant flow is no longer a suitable authentication method. The silent SSO features of the implicit flow do not work without third party cookies, causing applications to break when they attempt to get a new token. We strongly recommend that all new applications use the authorization code flow that now supports single page apps in place of the implicit flow, and that existing single page apps begin migrating to the authorization code flow as well.
- Updated @azure/core-tracing to version
1.0.0-preview.11. See @azure/core-tracing CHANGELOG for details about breaking changes with tracing.
This update marks the preview for the first major version update of the @azure/identity package since the first stable version was released in October, 2019. This is mainly driven by the improvements we are making for the InteractiveBrowserCredential when used in browser applications by updating it to use the new @azure/msal-browser which is replacing the older msal package.
- Changes to
InteractiveBrowserCredential- When used in browser applications, the
InteractiveBrowserCredentialhas been updated to use the Auth Code Flow with PKCE rather than Implicit Grant Flow by default to better support browsers with enhanced security restrictions. Please note that this credential always used the Auth Code Flow when used in Node.js applications. Read more on this in our docs on Interactive Browser Credential. - The default client ID used for
InteractiveBrowserCredentialwas viable only in Node.js and not for the browser. Therefore, client Id is now a required parameter when constructing this credential in browser applications. - The
loginStyleandflowoptions to the constructor forInteractiveBrowserCredentialwill now show up only when used in browser applications as these were never applicable to Node.js - Removed the
postLogoutRedirectUrifrom the options to the constructor forInteractiveBrowserCredential. This option was not being used since we don't have a way for users to log out yet.
- When used in browser applications, the
- When a token is not available, some credentials had the promise returned by the
getTokenmethod resolve withnull, others had thegetTokenmethod throw theCredentialUnavailableerror. This behavior is now made consistent across all credentials to throw theCredentialUnavailableerror.- This change has no bearing on the user if all they ever did was create the credentials and pass it to the Azure SDKs.
- This change affects only those users who called the
getToken()method directly and did not handle resulting errors.
- The constructor for
DeviceCodeCredentialalways had multiple optional parameters and no required ones. As per our guidelines, this has now been simplified to take a single optional bag of parameters.
- Changes to
InteractiveBrowserCredential,DeviceCodeCredential,ClientSecretCredential,ClientCertificateCredentialandUsernamePasswordCredential:- Migrated to use the latest MSAL. This update improves caching of tokens, significantly reducing the number of network requests.
- Added the feature of persistence caching of credentials. This is driven by the new
tokenCachePersistenceOptionsoption available in the options you pass to the credential constructors.- For now, to use this feature, users will need to install
@azure/msal-node-extensions1.0.0-alpha.6 on their own. This experience will be improved in the next update. - This feature uses DPAPI on Windows, it tries to use the Keychain on OSX and the Keyring on Linux.
- To learn more on the usage, please refer to our docs on the
TokenCachePersistenceOptionsinterface. - IMPORTANT: As part of this beta, this feature is only supported in Node 10, 12 and 14.
- For now, to use this feature, users will need to install
- Changes to
InteractiveBrowserCredentialandDeviceCodeCredential:- You can now control when the credential requests user input with the new
disableAutomaticAuthenticationoption added to the options you pass to the credential constructors.- When enabled, this option stops the
getToken()method from requesting user input in case the credential is unable to authenticate silently. - If
getToken()fails to authenticate without user interaction, anddisableAutomaticAuthenticationhas been set to true, a new error will be thrown:AuthenticationRequired. You may use this error to identify scenarios when manual authentication needs to be triggered (withauthenticate(), as described in the next point).
- When enabled, this option stops the
- A new method
authenticate()is added to these credentials which is similar togetToken(), but it does not read thedisableAutomaticAuthenticationoption described above.- Use this to get an
AuthenticationRecordwhich you can then use to create new credentials that will re-use the token information. - The
AuthenticationRecordobject has aserialize()method that allows an authenticated account to be stored as a string and re-used in another credential at any time. Use the new helper functiondeserializeAuthenticationRecordto de-serialize this string. authenticate()might succeed and still returnundefinedif we're unable to pick just one account record from the cache. This might happen if the cache is being used by more than one credential, or if multiple users have authenticated using the same Client ID and Tenant ID. To ensure consistency on a program with many users, please keep track of theAuthenticationRecordand provide them in the constructors of the credentials on initialization.
- Use this to get an
- You can now control when the credential requests user input with the new
- Updated the
@azure/msal-nodedependency to^1.0.0. DefaultAzureCredential's implementation for browsers is simplified to throw theBrowserNotSupportedErrorin its constructor. Previously, we relied on getting the same error from trying to instantiate the different credentials thatDefaultAzureCredentialsupports in Node.js.- As before, please use only the
InteractiveBrowserCredentialin your browser applications.
- As before, please use only the
- For the
InteractiveBrowserCredentialfor node, replaced the use of theexpressmodule with a native http server for Node, shrinking the resulting identity module considerably.
This release doesn't have the changes from 1.2.4-beta.1.
- Bug fix: Now if the
managedIdentityClientIdoptional parameter is provided toDefaultAzureCredential, it will be properly passed through to the underlyingManagedIdentityCredential. Related to customer issue: 13872. - Bug fix:
ManagedIdentityCredentialnow also properly handlesEHOSTUNREACHerrors. Fixes issue 13894.
- Breaking Change: Updated
InteractiveBrowserCredentialto use the Auth Code Flow with PKCE rather than Implicit Grant Flow by default in the browser, to better support browsers with enhanced security restrictions. A new file was added to provide more information about this credential here.
- Fixed Azure Stack support for the Node.js version of the
InteractiveBrowserCredential. Fixes issue 11220. - The 'keytar' dependency has been updated to the latest version.
- No longer overrides global Axios defaults. This includes an update in
@azure/identity's source, and an update of the@azure/msal-nodedependency. Fixes issue 13343.
- Upgrading to the msal-node dependency due to a severe vulnerability in Axios. Link to the documented vulnerability: link. Fixes issue 13088.
- Upgrading to Axios 0.21.1 due to a severe vulnerability in Axios. Link to the documented vulnerability: link. Fixes issue 13088.
- With 1.2, we've added support for Azure Arc to our Managed Identity credential.
- We've also added an Interactive Browser credential for Node, which spawns the user's browser and connects via a browser-based auth code flow. This is powered by the Microsoft Authentication Library (MSAL)
- We've moved
DeviceCodeCredentialto also use the Microsoft Authentication Library (MSAL) - Identity now supports Subject Name/Issuer (SNI) as part of authentication for ClientCertificateCredential.
- Added Active Directory Federation Services authority host support to the node credentials.
ManagedIdentityCredentialhas been aligned with other languages, and now treats expected errors properly.- Added support for multiple clouds on
VisualStudioCodeCredential.
ManagedIdentityCredentialnow only checks for available MSIs once per class instance.ManagedIdentityCredentialnow supports Azure Arc environments.ManagedIdentityCredentialnow supports Azure Service Fabric environments.- Added authority host for multiple clouds on
VisualStudioCodeCredential, and specifiedAzureCloudas the default cloud name. DeviceCodeCredentialnow has both of its constructor parameters,tenantIdandclientId, as optional parameters. The default value oftenantIdis "organizations", and the Azure CLI's client ID is the default value ofclientId.- We've removed the persistent cache support from the previous beta.
DeviceCodeCredentialnow by default shows the Device Code message on the console. This can still be overwritten with a custom behavior by specifying a function as the third parameter,userPromptCallback.- Added support for multiple clouds on
VisualStudioCodeCredential. Fixes customer issue 11452. ManagedIdentityCredentialhas been aligned with other languages, now treating expected errors properly. This fixes customer issue 11451.InteractiveBrowserCredentialauthentication now uses the silent flow if the user provides a cache and authentication record for lookup.- Added Active Directory Federation Services authority host support to the node credentials.
- Reverted a change in 1.2.0-beta.1 which moved
@rollup/plugin-jsonfromdevDependenciestodependencies.@rollup/plugin-jsonwas placed as a dependency due to an oversight, and it is not a necessary dependency for@azure/identity.
- A new
InteractiveBrowserCredentialfor node which will spawn a web server, start a web browser, and allow the user to interactively authenticate with the browser. - With 1.2.0-beta.1, Identity will now use MSAL to perform authentication. With this beta, DeviceCodeCredential and a new InteractiveBrowserCredential for node are powered by MSAL.
- Identity now supports Subject Name/Issuer (SNI) as part of authentication for ClientCertificateCredential
- Upgraded App Services MSI API version
- With 1.1.0, new developer credentials are now available:
VisualStudioCodeCredentialandAzureCliCredential.VisualStudioCodeCredentialallows developers to log into Azure using the credentials available after logging in through the Azure Account extension in Visual Studio Code.AzureCliCredentialallows developers to log into Azure using the login credentials after an "az login" call.
- Both
VisualStudioCodeCredentialandAzureCliCredentialmay be used directly or indirectly as part ofDefaultAzureCredential. - Added the ability to configure the Managed Identity with a user-assigned client ID via a new option available in the
DefaultAzureCredentialconstructor options:managedIdentityClientId. - Made a list of known authorities is now available via a new top-level constant:
AzureAuthorityHosts. - Introduced the
CredentialUnavailableerror, which allows developers to differentiate between a credential not being available and an error happening during authentication.
- Renamed the
VSCodeCredentialtoVisualStudioCodeCredential, and its options parameter fromVSCodeCredentialOptionstoVisualStudioCodeCredentialOptions. - Tenant information is now loaded from the Visual Studio Code settings file when the
VisualStudioCodeCredentialis used. - Added
managedIdentityClientIdto optionally pass in a user-assigned client ID for theManagedIdentityCredential.
- Make the keytar dependency optional, allowing for building and running on platforms not supported by keytar PR #10142
- DefaultAzureCredential and VSCodeCredential can now take a tenant id as part of the options object
- KnownAuthorityHosts has been renamed to AzureAuthorityHosts
- Switch to using CredentialUnavailable to differentiate from expected and unexpected errors during DefaultAzureCredential startup. PR #8172
- Make all developer credentials public as well as the list used by DefaultAzureCredential PR #9274
- Add ability to read AZURE_AUTHORITY_HOST from environment (PR #8226 PR #8343)
- Update to OpenTelemetry 0.6 (PR #7998)
- Set expires_on at a higher precedence for IMDS (PR #8591)
- Make KnownAuthorityHosts constants available
- Extended DefaultAzureCredential with an experimental credential that uses the login credential from VSCode's Azure Account extension
- Extended DefaultAzureCredential with an experimental credential that uses the login credential from Azure CLI
- Fix tracing to set correct span attributes (PR #6565).
- Fixed an issue where an authorization error occurs due to wrong access token being returned by the MSI endpoint when using a user-assigned managed identity with
ManagedIdentityCredential(PR #6134) - Fixed an issue in
EnvironmentCredentialwhere authentication silently fails when one or more of the expected environment variables is not present (PR #6313) - Updated to use OpenTelemetry 0.2 via
@azure/core-tracing
- This release marks the general availability of the
@azure/identitypackage. EnvironmentCredentialnow looks for additional environment variables: (PR #5743)AZURE_CLIENT_CERTIFICATE_PATHto configureClientCertificateCredentialAZURE_USERNAMEandAZURE_PASSWORDto configureUsernamePasswordCredential
GetTokenOptionsnow extends the interfaceOperationOptions(PR #5899)TokenCredentialOptionsnow extends the interfacePipelineOptions(PR #5711)- Renamed
IdentityClientOptionstoTokenCredentialOptions(PR #5797) - Removed the browser bundle. A browser-compatible library can still be created through the use of a bundler such as Rollup, Webpack, or Parcel (PR #5863)
- Renamed
DeviceCodeDetailstoDeviceCodeInfoand improved casing of the fields in theErrorResponsetype (PR #5662) - Improved the constructor signatures for
AuthorizationCodeCredential,DeviceCodeCredential,InteractiveBrowserCredentialandmanagedIdentityCredentialso that it's clearer which parameters are optional and what additional values they accept (PR #5668) - Added logging for authentication flows via the new
@azure/loggerpackage (PR #5611) - Fixed an issue in
DeviceCodeCredentialwhere an unexpected authentication error could cause an infinite polling loop (PR #5430) - Improved the details that appear in the
AggregateAuthenticationError(PR #5409)
- Update
@azure/core-tracingdependency to resolve an issue when running in Internet Explorer 11 (PR #5472)
- Introduced the
AuthorizationCodeCredentialfor performing the authorization code flow with Microsoft Entra ID (PR #5356) - Fixed an issue preventing the
ManagedIdentityCredentialfrom working inside of Azure Function Apps (PR #5144) - Added tracing to
IdentityClientand credential implementations (PR #5283) - Improved the exception message for
AggregateAuthenticationErrorso that errors thrown fromDefaultAzureCredentialare now more actionable (PR #5409)
- Fixed a ping timeout issue. The timeout is now configurable. (PR #4941)
- Fixed IMDS endpoint detection false positive (PR #4909)
- Introduced the following credential types:
DeviceCodeCredential.InteractiveBrowserCredential.UsernamePasswordCredential.
- This library can now be used in the browser! The following credential types supported in browser builds:
ClientSecretCredential.UsernamePasswordCredential.InteractiveBrowserCredential.
For release notes and more information please visit https://aka.ms/azsdk/releases/july2019preview
- Introduced the following credential types:
DefaultAzureCredential.EnvironmentCredential.ManagedIdentityCredential.ClientSecretCredential.ClientCertificateCredential.ChainedTokenCredential.