@azure/msal-node 3.4.0 → 3.4.1

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.
Files changed (62) hide show
  1. package/dist/cache/NodeStorage.mjs +1 -1
  2. package/dist/cache/TokenCache.mjs +1 -1
  3. package/dist/cache/distributed/DistributedCachePlugin.mjs +1 -1
  4. package/dist/cache/serializer/Deserializer.mjs +1 -1
  5. package/dist/cache/serializer/Serializer.mjs +1 -1
  6. package/dist/client/ClientApplication.d.ts.map +1 -1
  7. package/dist/client/ClientApplication.mjs +3 -1
  8. package/dist/client/ClientApplication.mjs.map +1 -1
  9. package/dist/client/ClientAssertion.mjs +1 -1
  10. package/dist/client/ClientCredentialClient.mjs +1 -1
  11. package/dist/client/ConfidentialClientApplication.mjs +1 -1
  12. package/dist/client/DeviceCodeClient.mjs +1 -1
  13. package/dist/client/ManagedIdentityApplication.mjs +1 -1
  14. package/dist/client/ManagedIdentityClient.mjs +1 -1
  15. package/dist/client/ManagedIdentitySources/AppService.mjs +1 -1
  16. package/dist/client/ManagedIdentitySources/AzureArc.mjs +1 -1
  17. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs +1 -1
  18. package/dist/client/ManagedIdentitySources/CloudShell.mjs +1 -1
  19. package/dist/client/ManagedIdentitySources/Imds.mjs +1 -1
  20. package/dist/client/ManagedIdentitySources/MachineLearning.mjs +1 -1
  21. package/dist/client/ManagedIdentitySources/ServiceFabric.mjs +1 -1
  22. package/dist/client/OnBehalfOfClient.mjs +1 -1
  23. package/dist/client/PublicClientApplication.mjs +1 -1
  24. package/dist/client/UsernamePasswordClient.d.ts.map +1 -1
  25. package/dist/client/UsernamePasswordClient.mjs +3 -3
  26. package/dist/client/UsernamePasswordClient.mjs.map +1 -1
  27. package/dist/config/Configuration.mjs +1 -1
  28. package/dist/config/ManagedIdentityId.mjs +1 -1
  29. package/dist/config/ManagedIdentityRequestParameters.mjs +1 -1
  30. package/dist/crypto/CryptoProvider.mjs +1 -1
  31. package/dist/crypto/GuidGenerator.mjs +1 -1
  32. package/dist/crypto/HashUtils.mjs +1 -1
  33. package/dist/crypto/PkceGenerator.mjs +1 -1
  34. package/dist/error/ManagedIdentityError.mjs +1 -1
  35. package/dist/error/ManagedIdentityErrorCodes.mjs +1 -1
  36. package/dist/error/NodeAuthError.mjs +1 -1
  37. package/dist/index.mjs +1 -1
  38. package/dist/internals.mjs +1 -1
  39. package/dist/network/HttpClient.mjs +1 -1
  40. package/dist/network/HttpClientWithRetries.mjs +1 -1
  41. package/dist/network/LoopbackClient.mjs +1 -1
  42. package/dist/packageMetadata.d.ts +1 -1
  43. package/dist/packageMetadata.mjs +2 -2
  44. package/dist/protocol/Authorize.d.ts.map +1 -1
  45. package/dist/protocol/Authorize.mjs +4 -3
  46. package/dist/protocol/Authorize.mjs.map +1 -1
  47. package/dist/retry/LinearRetryPolicy.mjs +1 -1
  48. package/dist/utils/Constants.mjs +1 -1
  49. package/dist/utils/EncodingUtils.mjs +1 -1
  50. package/dist/utils/NetworkUtils.mjs +1 -1
  51. package/dist/utils/TimeUtils.mjs +1 -1
  52. package/lib/msal-node.cjs +104 -91
  53. package/lib/msal-node.cjs.map +1 -1
  54. package/lib/types/client/ClientApplication.d.ts.map +1 -1
  55. package/lib/types/client/UsernamePasswordClient.d.ts.map +1 -1
  56. package/lib/types/packageMetadata.d.ts +1 -1
  57. package/lib/types/protocol/Authorize.d.ts.map +1 -1
  58. package/package.json +2 -2
  59. package/src/client/ClientApplication.ts +2 -0
  60. package/src/client/UsernamePasswordClient.ts +5 -1
  61. package/src/packageMetadata.ts +1 -1
  62. package/src/protocol/Authorize.ts +7 -1
package/lib/msal-node.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v3.4.0 2025-03-20 */
1
+ /*! @azure/msal-node v3.4.1 2025-03-25 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
@@ -152,7 +152,7 @@ class Serializer {
152
152
  }
153
153
  }
154
154
 
155
- /*! @azure/msal-common v15.3.0 2025-03-20 */
155
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
156
156
  /*
157
157
  * Copyright (c) Microsoft Corporation. All rights reserved.
158
158
  * Licensed under the MIT License.
@@ -187,11 +187,8 @@ const Constants$1 = {
187
187
  PROFILE_SCOPE: "profile",
188
188
  OFFLINE_ACCESS_SCOPE: "offline_access",
189
189
  EMAIL_SCOPE: "email",
190
- // Default response type for authorization code flow
191
- CODE_RESPONSE_TYPE: "code",
192
190
  CODE_GRANT_TYPE: "authorization_code",
193
191
  RT_GRANT_TYPE: "refresh_token",
194
- FRAGMENT_RESPONSE_MODE: "fragment",
195
192
  S256_CODE_CHALLENGE_METHOD: "S256",
196
193
  URL_FORM_CONTENT_TYPE: "application/x-www-form-urlencoded;charset=utf-8",
197
194
  AUTHORIZATION_PENDING: "authorization_pending",
@@ -211,8 +208,6 @@ const Constants$1 = {
211
208
  "login.microsoft.com",
212
209
  "sts.windows.net",
213
210
  ],
214
- TOKEN_RESPONSE_TYPE: "token",
215
- ID_TOKEN_RESPONSE_TYPE: "id_token",
216
211
  SHR_NONCE_VALIDITY: 240,
217
212
  INVALID_INSTANCE: "invalid_instance",
218
213
  };
@@ -291,17 +286,19 @@ const CodeChallengeMethodValues = {
291
286
  S256: "S256",
292
287
  };
293
288
  /**
294
- * allowed values for server response type
289
+ * Allowed values for response_type
295
290
  */
296
- const ServerResponseType = {
297
- QUERY: "query",
298
- FRAGMENT: "fragment",
291
+ const OAuthResponseType = {
292
+ CODE: "code",
293
+ IDTOKEN_TOKEN: "id_token token",
294
+ IDTOKEN_TOKEN_REFRESHTOKEN: "id_token token refresh_token",
299
295
  };
300
296
  /**
301
297
  * allowed values for response_mode
302
298
  */
303
299
  const ResponseMode = {
304
- ...ServerResponseType,
300
+ QUERY: "query",
301
+ FRAGMENT: "fragment",
305
302
  FORM_POST: "form_post",
306
303
  };
307
304
  /**
@@ -445,7 +442,7 @@ const CacheOutcome = {
445
442
  // Token renewal offset default in seconds
446
443
  const DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;
447
444
 
448
- /*! @azure/msal-common v15.3.0 2025-03-20 */
445
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
449
446
  /*
450
447
  * Copyright (c) Microsoft Corporation. All rights reserved.
451
448
  * Licensed under the MIT License.
@@ -462,7 +459,7 @@ var AuthErrorCodes = /*#__PURE__*/Object.freeze({
462
459
  unexpectedError: unexpectedError
463
460
  });
464
461
 
465
- /*! @azure/msal-common v15.3.0 2025-03-20 */
462
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
466
463
 
467
464
  /*
468
465
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -511,7 +508,7 @@ function createAuthError(code, additionalMessage) {
511
508
  : AuthErrorMessages[code]);
512
509
  }
513
510
 
514
- /*! @azure/msal-common v15.3.0 2025-03-20 */
511
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
515
512
  /*
516
513
  * Copyright (c) Microsoft Corporation. All rights reserved.
517
514
  * Licensed under the MIT License.
@@ -609,7 +606,7 @@ var ClientAuthErrorCodes = /*#__PURE__*/Object.freeze({
609
606
  userTimeoutReached: userTimeoutReached
610
607
  });
611
608
 
612
- /*! @azure/msal-common v15.3.0 2025-03-20 */
609
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
613
610
 
614
611
  /*
615
612
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -861,7 +858,7 @@ function createClientAuthError(errorCode, additionalMessage) {
861
858
  return new ClientAuthError(errorCode, additionalMessage);
862
859
  }
863
860
 
864
- /*! @azure/msal-common v15.3.0 2025-03-20 */
861
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
865
862
 
866
863
  /*
867
864
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -900,7 +897,7 @@ const DEFAULT_CRYPTO_IMPLEMENTATION = {
900
897
  },
901
898
  };
902
899
 
903
- /*! @azure/msal-common v15.3.0 2025-03-20 */
900
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
904
901
 
905
902
  /*
906
903
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1091,12 +1088,12 @@ class Logger {
1091
1088
  }
1092
1089
  }
1093
1090
 
1094
- /*! @azure/msal-common v15.3.0 2025-03-20 */
1091
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
1095
1092
  /* eslint-disable header/header */
1096
1093
  const name$1 = "@azure/msal-common";
1097
- const version$1 = "15.3.0";
1094
+ const version$1 = "15.4.0";
1098
1095
 
1099
- /*! @azure/msal-common v15.3.0 2025-03-20 */
1096
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
1100
1097
  /*
1101
1098
  * Copyright (c) Microsoft Corporation. All rights reserved.
1102
1099
  * Licensed under the MIT License.
@@ -1116,7 +1113,7 @@ const AzureCloudInstance = {
1116
1113
  AzureUsGovernment: "https://login.microsoftonline.us",
1117
1114
  };
1118
1115
 
1119
- /*! @azure/msal-common v15.3.0 2025-03-20 */
1116
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
1120
1117
 
1121
1118
  /*
1122
1119
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1177,7 +1174,7 @@ function checkMaxAge(authTime, maxAge) {
1177
1174
  }
1178
1175
  }
1179
1176
 
1180
- /*! @azure/msal-common v15.3.0 2025-03-20 */
1177
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
1181
1178
  /*
1182
1179
  * Copyright (c) Microsoft Corporation. All rights reserved.
1183
1180
  * Licensed under the MIT License.
@@ -1232,7 +1229,7 @@ function delay(t, value) {
1232
1229
  return new Promise((resolve) => setTimeout(() => resolve(value), t));
1233
1230
  }
1234
1231
 
1235
- /*! @azure/msal-common v15.3.0 2025-03-20 */
1232
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
1236
1233
 
1237
1234
  /*
1238
1235
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1559,7 +1556,7 @@ function isAuthorityMetadataExpired(metadata) {
1559
1556
  return metadata.expiresAt <= nowSeconds();
1560
1557
  }
1561
1558
 
1562
- /*! @azure/msal-common v15.3.0 2025-03-20 */
1559
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
1563
1560
  /*
1564
1561
  * Copyright (c) Microsoft Corporation. All rights reserved.
1565
1562
  * Licensed under the MIT License.
@@ -1613,7 +1610,7 @@ var ClientConfigurationErrorCodes = /*#__PURE__*/Object.freeze({
1613
1610
  urlParseError: urlParseError
1614
1611
  });
1615
1612
 
1616
- /*! @azure/msal-common v15.3.0 2025-03-20 */
1613
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
1617
1614
 
1618
1615
  /*
1619
1616
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1751,7 +1748,7 @@ function createClientConfigurationError(errorCode) {
1751
1748
  return new ClientConfigurationError(errorCode);
1752
1749
  }
1753
1750
 
1754
- /*! @azure/msal-common v15.3.0 2025-03-20 */
1751
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
1755
1752
  /*
1756
1753
  * Copyright (c) Microsoft Corporation. All rights reserved.
1757
1754
  * Licensed under the MIT License.
@@ -1848,7 +1845,7 @@ class StringUtils {
1848
1845
  }
1849
1846
  }
1850
1847
 
1851
- /*! @azure/msal-common v15.3.0 2025-03-20 */
1848
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
1852
1849
 
1853
1850
  /*
1854
1851
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2039,7 +2036,7 @@ class ScopeSet {
2039
2036
  }
2040
2037
  }
2041
2038
 
2042
- /*! @azure/msal-common v15.3.0 2025-03-20 */
2039
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
2043
2040
 
2044
2041
  /*
2045
2042
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2079,7 +2076,7 @@ function buildClientInfoFromHomeAccountId(homeAccountId) {
2079
2076
  };
2080
2077
  }
2081
2078
 
2082
- /*! @azure/msal-common v15.3.0 2025-03-20 */
2079
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
2083
2080
  /*
2084
2081
  * Copyright (c) Microsoft Corporation. All rights reserved.
2085
2082
  * Licensed under the MIT License.
@@ -2158,7 +2155,7 @@ function updateAccountTenantProfileData(baseAccountInfo, tenantProfile, idTokenC
2158
2155
  return updatedAccountInfo;
2159
2156
  }
2160
2157
 
2161
- /*! @azure/msal-common v15.3.0 2025-03-20 */
2158
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
2162
2159
  /*
2163
2160
  * Copyright (c) Microsoft Corporation. All rights reserved.
2164
2161
  * Licensed under the MIT License.
@@ -2173,7 +2170,7 @@ const AuthorityType = {
2173
2170
  Ciam: 3,
2174
2171
  };
2175
2172
 
2176
- /*! @azure/msal-common v15.3.0 2025-03-20 */
2173
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
2177
2174
  /*
2178
2175
  * Copyright (c) Microsoft Corporation. All rights reserved.
2179
2176
  * Licensed under the MIT License.
@@ -2195,7 +2192,7 @@ function getTenantIdFromIdTokenClaims(idTokenClaims) {
2195
2192
  return null;
2196
2193
  }
2197
2194
 
2198
- /*! @azure/msal-common v15.3.0 2025-03-20 */
2195
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
2199
2196
  /*
2200
2197
  * Copyright (c) Microsoft Corporation. All rights reserved.
2201
2198
  * Licensed under the MIT License.
@@ -2204,11 +2201,22 @@ function getTenantIdFromIdTokenClaims(idTokenClaims) {
2204
2201
  * Protocol modes supported by MSAL.
2205
2202
  */
2206
2203
  const ProtocolMode = {
2204
+ /**
2205
+ * Auth Code + PKCE with Entra ID (formerly AAD) specific optimizations and features
2206
+ */
2207
2207
  AAD: "AAD",
2208
+ /**
2209
+ * Auth Code + PKCE without Entra ID specific optimizations and features. For use only with non-Microsoft owned authorities.
2210
+ * Support is limited for this mode.
2211
+ */
2208
2212
  OIDC: "OIDC",
2213
+ /**
2214
+ * Encrypted Authorize Response (EAR) with Entra ID specific optimizations and features
2215
+ */
2216
+ EAR: "EAR",
2209
2217
  };
2210
2218
 
2211
- /*! @azure/msal-common v15.3.0 2025-03-20 */
2219
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
2212
2220
 
2213
2221
  /*
2214
2222
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2304,11 +2312,11 @@ class AccountEntity {
2304
2312
  if (authority.authorityType === AuthorityType.Adfs) {
2305
2313
  account.authorityType = CacheAccountType.ADFS_ACCOUNT_TYPE;
2306
2314
  }
2307
- else if (authority.protocolMode === ProtocolMode.AAD) {
2308
- account.authorityType = CacheAccountType.MSSTS_ACCOUNT_TYPE;
2315
+ else if (authority.protocolMode === ProtocolMode.OIDC) {
2316
+ account.authorityType = CacheAccountType.GENERIC_ACCOUNT_TYPE;
2309
2317
  }
2310
2318
  else {
2311
- account.authorityType = CacheAccountType.GENERIC_ACCOUNT_TYPE;
2319
+ account.authorityType = CacheAccountType.MSSTS_ACCOUNT_TYPE;
2312
2320
  }
2313
2321
  let clientInfo;
2314
2322
  if (accountDetails.clientInfo && base64Decode) {
@@ -2451,7 +2459,7 @@ class AccountEntity {
2451
2459
  }
2452
2460
  }
2453
2461
 
2454
- /*! @azure/msal-common v15.3.0 2025-03-20 */
2462
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
2455
2463
 
2456
2464
  /*
2457
2465
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2486,6 +2494,7 @@ function getDeserializedResponse(responseString) {
2486
2494
  const deserializedHash = Object.fromEntries(new URLSearchParams(normalizedResponse));
2487
2495
  // Check for known response properties
2488
2496
  if (deserializedHash.code ||
2497
+ deserializedHash.ear_jwe ||
2489
2498
  deserializedHash.error ||
2490
2499
  deserializedHash.error_description ||
2491
2500
  deserializedHash.state) {
@@ -2508,7 +2517,7 @@ function mapToQueryString(parameters) {
2508
2517
  return queryParameterArray.join("&");
2509
2518
  }
2510
2519
 
2511
- /*! @azure/msal-common v15.3.0 2025-03-20 */
2520
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
2512
2521
 
2513
2522
  /*
2514
2523
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2672,7 +2681,7 @@ class UrlString {
2672
2681
  }
2673
2682
  }
2674
2683
 
2675
- /*! @azure/msal-common v15.3.0 2025-03-20 */
2684
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
2676
2685
 
2677
2686
  /*
2678
2687
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2812,7 +2821,7 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
2812
2821
  return null;
2813
2822
  }
2814
2823
 
2815
- /*! @azure/msal-common v15.3.0 2025-03-20 */
2824
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
2816
2825
  /*
2817
2826
  * Copyright (c) Microsoft Corporation. All rights reserved.
2818
2827
  * Licensed under the MIT License.
@@ -2820,7 +2829,7 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
2820
2829
  const cacheQuotaExceededErrorCode = "cache_quota_exceeded";
2821
2830
  const cacheUnknownErrorCode = "cache_error_unknown";
2822
2831
 
2823
- /*! @azure/msal-common v15.3.0 2025-03-20 */
2832
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
2824
2833
 
2825
2834
  /*
2826
2835
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2847,7 +2856,7 @@ class CacheError extends Error {
2847
2856
  }
2848
2857
  }
2849
2858
 
2850
- /*! @azure/msal-common v15.3.0 2025-03-20 */
2859
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
2851
2860
 
2852
2861
  /*
2853
2862
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4031,7 +4040,7 @@ class DefaultStorageClass extends CacheManager {
4031
4040
  }
4032
4041
  }
4033
4042
 
4034
- /*! @azure/msal-common v15.3.0 2025-03-20 */
4043
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
4035
4044
 
4036
4045
  /*
4037
4046
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4130,7 +4139,7 @@ function isOidcProtocolMode(config) {
4130
4139
  return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);
4131
4140
  }
4132
4141
 
4133
- /*! @azure/msal-common v15.3.0 2025-03-20 */
4142
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
4134
4143
  /*
4135
4144
  * Copyright (c) Microsoft Corporation. All rights reserved.
4136
4145
  * Licensed under the MIT License.
@@ -4140,7 +4149,7 @@ const CcsCredentialType = {
4140
4149
  UPN: "UPN",
4141
4150
  };
4142
4151
 
4143
- /*! @azure/msal-common v15.3.0 2025-03-20 */
4152
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
4144
4153
  /*
4145
4154
  * Copyright (c) Microsoft Corporation. All rights reserved.
4146
4155
  * Licensed under the MIT License.
@@ -4191,7 +4200,7 @@ const BROKER_CLIENT_ID = "brk_client_id";
4191
4200
  const BROKER_REDIRECT_URI = "brk_redirect_uri";
4192
4201
  const INSTANCE_AWARE = "instance_aware";
4193
4202
 
4194
- /*! @azure/msal-common v15.3.0 2025-03-20 */
4203
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
4195
4204
 
4196
4205
  /*
4197
4206
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4210,16 +4219,12 @@ function instrumentBrokerParams(parameters, correlationId, performanceClient) {
4210
4219
  }
4211
4220
  }
4212
4221
  /**
4213
- * add response_type = code
4222
+ * Add the given response_type
4223
+ * @param parameters
4224
+ * @param responseType
4214
4225
  */
4215
- function addResponseTypeCode(parameters) {
4216
- parameters.set(RESPONSE_TYPE, Constants$1.CODE_RESPONSE_TYPE);
4217
- }
4218
- /**
4219
- * add response_type = token id_token
4220
- */
4221
- function addResponseTypeForTokenAndIdToken(parameters) {
4222
- parameters.set(RESPONSE_TYPE, `${Constants$1.TOKEN_RESPONSE_TYPE} ${Constants$1.ID_TOKEN_RESPONSE_TYPE}`);
4226
+ function addResponseType(parameters, responseType) {
4227
+ parameters.set(RESPONSE_TYPE, responseType);
4223
4228
  }
4224
4229
  /**
4225
4230
  * add response_mode. defaults to query.
@@ -4581,7 +4586,7 @@ function addBrokerParameters(parameters, brokerClientId, brokerRedirectUri) {
4581
4586
  }
4582
4587
  }
4583
4588
 
4584
- /*! @azure/msal-common v15.3.0 2025-03-20 */
4589
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
4585
4590
  /*
4586
4591
  * Copyright (c) Microsoft Corporation. All rights reserved.
4587
4592
  * Licensed under the MIT License.
@@ -4593,7 +4598,7 @@ function isOpenIdConfigResponse(response) {
4593
4598
  response.hasOwnProperty("jwks_uri"));
4594
4599
  }
4595
4600
 
4596
- /*! @azure/msal-common v15.3.0 2025-03-20 */
4601
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
4597
4602
  /*
4598
4603
  * Copyright (c) Microsoft Corporation. All rights reserved.
4599
4604
  * Licensed under the MIT License.
@@ -4603,7 +4608,7 @@ function isCloudInstanceDiscoveryResponse(response) {
4603
4608
  response.hasOwnProperty("metadata"));
4604
4609
  }
4605
4610
 
4606
- /*! @azure/msal-common v15.3.0 2025-03-20 */
4611
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
4607
4612
  /*
4608
4613
  * Copyright (c) Microsoft Corporation. All rights reserved.
4609
4614
  * Licensed under the MIT License.
@@ -4613,7 +4618,7 @@ function isCloudInstanceDiscoveryErrorResponse(response) {
4613
4618
  response.hasOwnProperty("error_description"));
4614
4619
  }
4615
4620
 
4616
- /*! @azure/msal-common v15.3.0 2025-03-20 */
4621
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
4617
4622
  /*
4618
4623
  * Copyright (c) Microsoft Corporation. All rights reserved.
4619
4624
  * Licensed under the MIT License.
@@ -4799,6 +4804,9 @@ const PerformanceEvents = {
4799
4804
  */
4800
4805
  HandleCodeResponseFromServer: "handleCodeResponseFromServer",
4801
4806
  HandleCodeResponse: "handleCodeResponse",
4807
+ HandleResponseEar: "handleResponseEar",
4808
+ HandleResponsePlatformBroker: "handleResponsePlatformBroker",
4809
+ HandleResponseCode: "handleResponseCode",
4802
4810
  UpdateTokenEndpointAuthority: "updateTokenEndpointAuthority",
4803
4811
  /**
4804
4812
  * APIs in Authorization Code Client (msal-common)
@@ -4865,9 +4873,11 @@ const PerformanceEvents = {
4865
4873
  UrlEncodeArr: "urlEncodeArr",
4866
4874
  Encrypt: "encrypt",
4867
4875
  Decrypt: "decrypt",
4876
+ GenerateEarKey: "generateEarKey",
4877
+ DecryptEarResponse: "decryptEarResponse",
4868
4878
  };
4869
4879
 
4870
- /*! @azure/msal-common v15.3.0 2025-03-20 */
4880
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
4871
4881
  /*
4872
4882
  * Copyright (c) Microsoft Corporation. All rights reserved.
4873
4883
  * Licensed under the MIT License.
@@ -4963,7 +4973,7 @@ const invokeAsync = (callback, eventName, logger, telemetryClient, correlationId
4963
4973
  };
4964
4974
  };
4965
4975
 
4966
- /*! @azure/msal-common v15.3.0 2025-03-20 */
4976
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
4967
4977
 
4968
4978
  /*
4969
4979
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5072,7 +5082,7 @@ RegionDiscovery.IMDS_OPTIONS = {
5072
5082
  },
5073
5083
  };
5074
5084
 
5075
- /*! @azure/msal-common v15.3.0 2025-03-20 */
5085
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
5076
5086
 
5077
5087
  /*
5078
5088
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5250,7 +5260,7 @@ class Authority {
5250
5260
  return (authorityUri.PathSegments.length === 1 &&
5251
5261
  !Authority.reservedTenantDomains.has(authorityUri.PathSegments[0]) &&
5252
5262
  this.getAuthorityType(authorityUri) === AuthorityType.Default &&
5253
- this.protocolMode === ProtocolMode.AAD);
5263
+ this.protocolMode !== ProtocolMode.OIDC);
5254
5264
  }
5255
5265
  /**
5256
5266
  * Replaces tenant in url path with current tenant. Defaults to common.
@@ -5297,7 +5307,7 @@ class Authority {
5297
5307
  const canonicalAuthorityHost = this.hostnameAndPort;
5298
5308
  if (this.canonicalAuthority.endsWith("v2.0/") ||
5299
5309
  this.authorityType === AuthorityType.Adfs ||
5300
- (this.protocolMode !== ProtocolMode.AAD &&
5310
+ (this.protocolMode === ProtocolMode.OIDC &&
5301
5311
  !this.isAliasOfKnownMicrosoftAuthority(canonicalAuthorityHost))) {
5302
5312
  return `${this.canonicalAuthority}.well-known/openid-configuration`;
5303
5313
  }
@@ -5911,7 +5921,7 @@ function buildStaticAuthorityOptions(authOptions) {
5911
5921
  };
5912
5922
  }
5913
5923
 
5914
- /*! @azure/msal-common v15.3.0 2025-03-20 */
5924
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
5915
5925
 
5916
5926
  /*
5917
5927
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5942,7 +5952,7 @@ async function createDiscoveredInstance(authorityUri, networkClient, cacheManage
5942
5952
  }
5943
5953
  }
5944
5954
 
5945
- /*! @azure/msal-common v15.3.0 2025-03-20 */
5955
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
5946
5956
 
5947
5957
  /*
5948
5958
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5961,7 +5971,7 @@ class ServerError extends AuthError {
5961
5971
  }
5962
5972
  }
5963
5973
 
5964
- /*! @azure/msal-common v15.3.0 2025-03-20 */
5974
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
5965
5975
  /*
5966
5976
  * Copyright (c) Microsoft Corporation. All rights reserved.
5967
5977
  * Licensed under the MIT License.
@@ -5982,7 +5992,7 @@ function getRequestThumbprint(clientId, request, homeAccountId) {
5982
5992
  };
5983
5993
  }
5984
5994
 
5985
- /*! @azure/msal-common v15.3.0 2025-03-20 */
5995
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
5986
5996
 
5987
5997
  /*
5988
5998
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6069,7 +6079,7 @@ class ThrottlingUtils {
6069
6079
  }
6070
6080
  }
6071
6081
 
6072
- /*! @azure/msal-common v15.3.0 2025-03-20 */
6082
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
6073
6083
 
6074
6084
  /*
6075
6085
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6089,7 +6099,7 @@ class NetworkError extends AuthError {
6089
6099
  }
6090
6100
  }
6091
6101
 
6092
- /*! @azure/msal-common v15.3.0 2025-03-20 */
6102
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
6093
6103
 
6094
6104
  /*
6095
6105
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6237,7 +6247,7 @@ class BaseClient {
6237
6247
  }
6238
6248
  }
6239
6249
 
6240
- /*! @azure/msal-common v15.3.0 2025-03-20 */
6250
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
6241
6251
  /*
6242
6252
  * Copyright (c) Microsoft Corporation. All rights reserved.
6243
6253
  * Licensed under the MIT License.
@@ -6263,7 +6273,7 @@ var InteractionRequiredAuthErrorCodes = /*#__PURE__*/Object.freeze({
6263
6273
  refreshTokenExpired: refreshTokenExpired
6264
6274
  });
6265
6275
 
6266
- /*! @azure/msal-common v15.3.0 2025-03-20 */
6276
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
6267
6277
 
6268
6278
  /*
6269
6279
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6351,7 +6361,7 @@ function createInteractionRequiredAuthError(errorCode) {
6351
6361
  return new InteractionRequiredAuthError(errorCode, InteractionRequiredAuthErrorMessages[errorCode]);
6352
6362
  }
6353
6363
 
6354
- /*! @azure/msal-common v15.3.0 2025-03-20 */
6364
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
6355
6365
 
6356
6366
  /*
6357
6367
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6423,7 +6433,7 @@ class ProtocolUtils {
6423
6433
  }
6424
6434
  }
6425
6435
 
6426
- /*! @azure/msal-common v15.3.0 2025-03-20 */
6436
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
6427
6437
 
6428
6438
  /*
6429
6439
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6507,7 +6517,7 @@ class PopTokenGenerator {
6507
6517
  }
6508
6518
  }
6509
6519
 
6510
- /*! @azure/msal-common v15.3.0 2025-03-20 */
6520
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
6511
6521
  /*
6512
6522
  * Copyright (c) Microsoft Corporation. All rights reserved.
6513
6523
  * Licensed under the MIT License.
@@ -6534,7 +6544,7 @@ class PopTokenGenerator {
6534
6544
  }
6535
6545
  }
6536
6546
 
6537
- /*! @azure/msal-common v15.3.0 2025-03-20 */
6547
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
6538
6548
 
6539
6549
  /*
6540
6550
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6865,7 +6875,7 @@ function buildAccountToCache(cacheStorage, authority, homeAccountId, base64Decod
6865
6875
  return baseAccount;
6866
6876
  }
6867
6877
 
6868
- /*! @azure/msal-common v15.3.0 2025-03-20 */
6878
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
6869
6879
 
6870
6880
  /*
6871
6881
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6932,7 +6942,7 @@ class RequestValidator {
6932
6942
  }
6933
6943
  }
6934
6944
 
6935
- /*! @azure/msal-common v15.3.0 2025-03-20 */
6945
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
6936
6946
  /*
6937
6947
  * Copyright (c) Microsoft Corporation. All rights reserved.
6938
6948
  * Licensed under the MIT License.
@@ -6950,7 +6960,7 @@ async function getClientAssertion(clientAssertion, clientId, tokenEndpoint) {
6950
6960
  }
6951
6961
  }
6952
6962
 
6953
- /*! @azure/msal-common v15.3.0 2025-03-20 */
6963
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
6954
6964
 
6955
6965
  /*
6956
6966
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7183,7 +7193,7 @@ class AuthorizationCodeClient extends BaseClient {
7183
7193
  }
7184
7194
  }
7185
7195
 
7186
- /*! @azure/msal-common v15.3.0 2025-03-20 */
7196
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
7187
7197
 
7188
7198
  /*
7189
7199
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7392,7 +7402,7 @@ class RefreshTokenClient extends BaseClient {
7392
7402
  }
7393
7403
  }
7394
7404
 
7395
- /*! @azure/msal-common v15.3.0 2025-03-20 */
7405
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
7396
7406
 
7397
7407
  /*
7398
7408
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7490,7 +7500,7 @@ class SilentFlowClient extends BaseClient {
7490
7500
  }
7491
7501
  }
7492
7502
 
7493
- /*! @azure/msal-common v15.3.0 2025-03-20 */
7503
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
7494
7504
 
7495
7505
  /*
7496
7506
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7611,10 +7621,10 @@ function getStandardAuthorizeRequestParameters(authOptions, request, logger, per
7611
7621
  if (request.embeddedClientId) {
7612
7622
  addBrokerParameters(parameters, authOptions.clientId, authOptions.redirectUri);
7613
7623
  }
7614
- if (request.extraQueryParameters) {
7615
- addExtraQueryParameters(parameters, request.extraQueryParameters);
7616
- }
7617
- if (authOptions.instanceAware) {
7624
+ // If extraQueryParameters includes instance_aware its value will be added when extraQueryParameters are added
7625
+ if (authOptions.instanceAware &&
7626
+ (!request.extraQueryParameters ||
7627
+ !Object.keys(request.extraQueryParameters).includes(INSTANCE_AWARE))) {
7618
7628
  addInstanceAware(parameters);
7619
7629
  }
7620
7630
  return parameters;
@@ -7640,7 +7650,7 @@ function extractLoginHint(account) {
7640
7650
  return account.idTokenClaims?.login_hint || null;
7641
7651
  }
7642
7652
 
7643
- /*! @azure/msal-common v15.3.0 2025-03-20 */
7653
+ /*! @azure/msal-common v15.4.0 2025-03-25 */
7644
7654
 
7645
7655
  /*
7646
7656
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -9933,7 +9943,7 @@ class ClientAssertion {
9933
9943
 
9934
9944
  /* eslint-disable header/header */
9935
9945
  const name = "@azure/msal-node";
9936
- const version = "3.4.0";
9946
+ const version = "3.4.1";
9937
9947
 
9938
9948
  /*
9939
9949
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -10000,7 +10010,7 @@ class UsernamePasswordClient extends BaseClient {
10000
10010
  addUsername(parameters, request.username);
10001
10011
  addPassword(parameters, request.password);
10002
10012
  addScopes(parameters, request.scopes);
10003
- addResponseTypeForTokenAndIdToken(parameters);
10013
+ addResponseType(parameters, OAuthResponseType.IDTOKEN_TOKEN);
10004
10014
  addGrantType(parameters, GrantType.RESOURCE_OWNER_PASSWORD_GRANT);
10005
10015
  addClientInfo(parameters);
10006
10016
  addLibraryInfo(parameters, this.config.libraryInfo);
@@ -10060,10 +10070,11 @@ function getAuthCodeRequestUrl(config, authority, request, logger) {
10060
10070
  if (config.auth.protocolMode !== ProtocolMode.OIDC) {
10061
10071
  addApplicationTelemetry(parameters, config.telemetry.application);
10062
10072
  }
10063
- addResponseTypeCode(parameters);
10073
+ addResponseType(parameters, OAuthResponseType.CODE);
10064
10074
  if (request.codeChallenge && request.codeChallengeMethod) {
10065
10075
  addCodeChallengeParams(parameters, request.codeChallenge, request.codeChallengeMethod);
10066
10076
  }
10077
+ addExtraQueryParameters(parameters, request.extraQueryParameters || {});
10067
10078
  return getAuthorizeUrl(authority, parameters);
10068
10079
  }
10069
10080
 
@@ -10102,6 +10113,8 @@ class ClientApplication {
10102
10113
  ...(await this.initializeBaseRequest(request)),
10103
10114
  responseMode: request.responseMode || ResponseMode.QUERY,
10104
10115
  authenticationScheme: AuthenticationScheme.BEARER,
10116
+ state: request.state || "",
10117
+ nonce: request.nonce || "",
10105
10118
  };
10106
10119
  const discoveredAuthority = await this.createAuthority(validRequest.authority, validRequest.correlationId, undefined, request.azureCloudOptions);
10107
10120
  return getAuthCodeRequestUrl(this.config, discoveredAuthority, validRequest, this.logger);