@azure/identity 4.1.0-alpha.20240325.2 → 4.1.0-alpha.20240328.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of @azure/identity might be problematic. Click here for more details.

package/dist/index.js CHANGED
@@ -1672,6 +1672,27 @@ var RegionalAuthority;
1672
1672
  /** Uses the {@link RegionalAuthority} for the Azure 'usdodcentral' region. */
1673
1673
  RegionalAuthority["GovernmentUSDodCentral"] = "usdodcentral";
1674
1674
  })(RegionalAuthority || (RegionalAuthority = {}));
1675
+ /**
1676
+ * Calculates the correct regional authority based on the supplied value
1677
+ * and the AZURE_REGIONAL_AUTHORITY_NAME environment variable.
1678
+ *
1679
+ * Values will be returned verbatim, except for {@link RegionalAuthority.AutoDiscoverRegion}
1680
+ * which is mapped to a value MSAL can understand.
1681
+ *
1682
+ * @internal
1683
+ */
1684
+ function calculateRegionalAuthority(regionalAuthority) {
1685
+ var _a, _b;
1686
+ let azureRegion = regionalAuthority;
1687
+ if (azureRegion === undefined &&
1688
+ ((_b = (_a = globalThis.process) === null || _a === void 0 ? void 0 : _a.env) === null || _b === void 0 ? void 0 : _b.AZURE_REGIONAL_AUTHORITY_NAME) !== undefined) {
1689
+ azureRegion = process.env.AZURE_REGIONAL_AUTHORITY_NAME;
1690
+ }
1691
+ if (azureRegion === RegionalAuthority.AutoDiscoverRegion) {
1692
+ return "AUTO_DISCOVER";
1693
+ }
1694
+ return azureRegion;
1695
+ }
1675
1696
 
1676
1697
  // Copyright (c) Microsoft Corporation.
1677
1698
  // Licensed under the MIT license.
@@ -1686,7 +1707,7 @@ var RegionalAuthority;
1686
1707
  */
1687
1708
  class MsalNode {
1688
1709
  constructor(options) {
1689
- var _a, _b, _c, _d, _e, _f, _g;
1710
+ var _a, _b, _c, _d, _e, _f;
1690
1711
  this.app = {};
1691
1712
  this.caeApp = {};
1692
1713
  this.requiresConfidential = false;
@@ -1726,10 +1747,7 @@ class MsalNode {
1726
1747
  "`useIdentityPlugin(createNativeBrokerPlugin())` before using `enableBroker`.",
1727
1748
  ].join(" "));
1728
1749
  }
1729
- this.azureRegion = (_g = options.regionalAuthority) !== null && _g !== void 0 ? _g : process.env.AZURE_REGIONAL_AUTHORITY_NAME;
1730
- if (this.azureRegion === RegionalAuthority.AutoDiscoverRegion) {
1731
- this.azureRegion = "AUTO_DISCOVER";
1732
- }
1750
+ this.azureRegion = calculateRegionalAuthority(options.regionalAuthority);
1733
1751
  }
1734
1752
  /**
1735
1753
  * Generates a MSAL configuration that generally works for Node.js
@@ -2901,7 +2919,7 @@ const logger$b = credentialLogger("AzureDeveloperCliCredential");
2901
2919
  * Azure Developer CLI is a command-line interface tool that allows developers to create, manage, and deploy
2902
2920
  * resources in Azure. It's built on top of the Azure CLI and provides additional functionality specific
2903
2921
  * to Azure developers. It allows users to authenticate as a user and/or a service principal against
2904
- * <a href="https://learn.microsoft.com/azure/active-directory/fundamentals/">Microsoft Entra ID</a>. The
2922
+ * <a href="https://learn.microsoft.com/entra/fundamentals/">Microsoft Entra ID</a>. The
2905
2923
  * AzureDeveloperCliCredential authenticates in a development environment and acquires a token on behalf of
2906
2924
  * the logged-in user or service principal in the Azure Developer CLI. It acts as the Azure Developer CLI logged in user or
2907
2925
  * service principal and executes an Azure CLI command underneath to authenticate the application against
@@ -3495,7 +3513,7 @@ const logger$7 = credentialLogger("ClientSecretCredential");
3495
3513
  * that was generated for an App Registration. More information on how
3496
3514
  * to configure a client secret can be found here:
3497
3515
  *
3498
- * https://learn.microsoft.com/azure/active-directory/develop/quickstart-configure-app-access-web-apis#add-credentials-to-your-web-application
3516
+ * https://learn.microsoft.com/entra/identity-platform/quickstart-configure-app-access-web-apis#add-credentials-to-your-web-application
3499
3517
  *
3500
3518
  */
3501
3519
  class ClientSecretCredential {
@@ -3993,12 +4011,12 @@ class InteractiveBrowserCredential {
3993
4011
  /**
3994
4012
  * Creates an instance of InteractiveBrowserCredential with the details needed.
3995
4013
  *
3996
- * This credential uses the [Authorization Code Flow](https://learn.microsoft.com/azure/active-directory/develop/v2-oauth2-auth-code-flow).
4014
+ * This credential uses the [Authorization Code Flow](https://learn.microsoft.com/entra/identity-platform/v2-oauth2-auth-code-flow).
3997
4015
  * On Node.js, it will open a browser window while it listens for a redirect response from the authentication service.
3998
4016
  * On browsers, it authenticates via popups. The `loginStyle` optional parameter can be set to `redirect` to authenticate by redirecting the user to an Azure secure login page, which then will redirect the user back to the web application where the authentication started.
3999
4017
  *
4000
4018
  * For Node.js, if a `clientId` is provided, the Microsoft Entra application will need to be configured to have a "Mobile and desktop applications" redirect endpoint.
4001
- * Follow our guide on [setting up Redirect URIs for Desktop apps that calls to web APIs](https://learn.microsoft.com/azure/active-directory/develop/scenario-desktop-app-registration#redirect-uris).
4019
+ * Follow our guide on [setting up Redirect URIs for Desktop apps that calls to web APIs](https://learn.microsoft.com/entra/identity-platform/scenario-desktop-app-registration#redirect-uris).
4002
4020
  *
4003
4021
  * @param options - Options for configuring the client which makes the authentication requests.
4004
4022
  */
@@ -4235,7 +4253,7 @@ const logger$1 = credentialLogger("AuthorizationCodeCredential");
4235
4253
  * that was obtained through the authorization code flow, described in more detail
4236
4254
  * in the Microsoft Entra ID documentation:
4237
4255
  *
4238
- * https://learn.microsoft.com/azure/active-directory/develop/v2-oauth2-auth-code-flow
4256
+ * https://learn.microsoft.com/entra/identity-platform/v2-oauth2-auth-code-flow
4239
4257
  */
4240
4258
  class AuthorizationCodeCredential {
4241
4259
  /**
@@ -4342,7 +4360,7 @@ class MsalOnBehalfOf extends MsalNode {
4342
4360
  const credentialName = "OnBehalfOfCredential";
4343
4361
  const logger = credentialLogger(credentialName);
4344
4362
  /**
4345
- * Enables authentication to Microsoft Entra ID using the [On Behalf Of flow](https://learn.microsoft.com/azure/active-directory/develop/v2-oauth2-on-behalf-of-flow).
4363
+ * Enables authentication to Microsoft Entra ID using the [On Behalf Of flow](https://learn.microsoft.com/entra/identity-platform/v2-oauth2-on-behalf-of-flow).
4346
4364
  */
4347
4365
  class OnBehalfOfCredential {
4348
4366
  constructor(options) {