@azure/msal-common 15.6.0 → 15.7.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 (136) hide show
  1. package/dist/account/AccountInfo.mjs +1 -1
  2. package/dist/account/AuthToken.mjs +1 -1
  3. package/dist/account/CcsCredential.mjs +1 -1
  4. package/dist/account/ClientInfo.mjs +1 -1
  5. package/dist/account/TokenClaims.mjs +1 -1
  6. package/dist/authority/Authority.mjs +1 -1
  7. package/dist/authority/AuthorityFactory.mjs +1 -1
  8. package/dist/authority/AuthorityMetadata.mjs +1 -1
  9. package/dist/authority/AuthorityOptions.mjs +1 -1
  10. package/dist/authority/AuthorityType.mjs +1 -1
  11. package/dist/authority/CloudInstanceDiscoveryErrorResponse.mjs +1 -1
  12. package/dist/authority/CloudInstanceDiscoveryResponse.mjs +1 -1
  13. package/dist/authority/OpenIdConfigResponse.mjs +1 -1
  14. package/dist/authority/ProtocolMode.mjs +1 -1
  15. package/dist/authority/RegionDiscovery.d.ts.map +1 -1
  16. package/dist/authority/RegionDiscovery.mjs +6 -9
  17. package/dist/authority/RegionDiscovery.mjs.map +1 -1
  18. package/dist/cache/CacheManager.d.ts +7 -7
  19. package/dist/cache/CacheManager.d.ts.map +1 -1
  20. package/dist/cache/CacheManager.mjs +27 -34
  21. package/dist/cache/CacheManager.mjs.map +1 -1
  22. package/dist/cache/entities/AccountEntity.mjs +1 -1
  23. package/dist/cache/interface/ICacheManager.d.ts +4 -4
  24. package/dist/cache/interface/ICacheManager.d.ts.map +1 -1
  25. package/dist/cache/persistence/TokenCacheContext.mjs +1 -1
  26. package/dist/cache/utils/CacheHelpers.mjs +1 -1
  27. package/dist/client/AuthorizationCodeClient.mjs +1 -1
  28. package/dist/client/BaseClient.mjs +1 -1
  29. package/dist/client/RefreshTokenClient.mjs +1 -1
  30. package/dist/client/SilentFlowClient.d.ts.map +1 -1
  31. package/dist/client/SilentFlowClient.mjs +2 -2
  32. package/dist/client/SilentFlowClient.mjs.map +1 -1
  33. package/dist/config/ClientConfiguration.d.ts.map +1 -1
  34. package/dist/config/ClientConfiguration.mjs +3 -2
  35. package/dist/config/ClientConfiguration.mjs.map +1 -1
  36. package/dist/constants/AADServerParamKeys.mjs +1 -1
  37. package/dist/crypto/ICrypto.d.ts +1 -1
  38. package/dist/crypto/ICrypto.d.ts.map +1 -1
  39. package/dist/crypto/ICrypto.mjs +1 -1
  40. package/dist/crypto/JoseHeader.mjs +1 -1
  41. package/dist/crypto/PopTokenGenerator.mjs +1 -1
  42. package/dist/error/AuthError.mjs +1 -1
  43. package/dist/error/AuthErrorCodes.mjs +1 -1
  44. package/dist/error/CacheError.mjs +1 -1
  45. package/dist/error/CacheErrorCodes.mjs +1 -1
  46. package/dist/error/ClientAuthError.mjs +1 -1
  47. package/dist/error/ClientAuthErrorCodes.mjs +1 -1
  48. package/dist/error/ClientConfigurationError.mjs +1 -1
  49. package/dist/error/ClientConfigurationErrorCodes.mjs +1 -1
  50. package/dist/error/InteractionRequiredAuthError.d.ts.map +1 -1
  51. package/dist/error/InteractionRequiredAuthError.mjs +4 -2
  52. package/dist/error/InteractionRequiredAuthError.mjs.map +1 -1
  53. package/dist/error/InteractionRequiredAuthErrorCodes.d.ts +1 -0
  54. package/dist/error/InteractionRequiredAuthErrorCodes.d.ts.map +1 -1
  55. package/dist/error/InteractionRequiredAuthErrorCodes.mjs +3 -2
  56. package/dist/error/InteractionRequiredAuthErrorCodes.mjs.map +1 -1
  57. package/dist/error/JoseHeaderError.mjs +1 -1
  58. package/dist/error/JoseHeaderErrorCodes.mjs +1 -1
  59. package/dist/error/NetworkError.mjs +1 -1
  60. package/dist/error/ServerError.mjs +1 -1
  61. package/dist/exports-common.d.ts +1 -1
  62. package/dist/exports-common.d.ts.map +1 -1
  63. package/dist/index-browser.mjs +2 -2
  64. package/dist/index-node.mjs +2 -2
  65. package/dist/index.mjs +2 -2
  66. package/dist/logger/Logger.mjs +1 -1
  67. package/dist/network/INetworkModule.mjs +1 -1
  68. package/dist/network/RequestThumbprint.mjs +1 -1
  69. package/dist/network/ThrottlingUtils.mjs +1 -1
  70. package/dist/packageMetadata.d.ts +1 -1
  71. package/dist/packageMetadata.mjs +2 -2
  72. package/dist/protocol/Authorize.mjs +1 -1
  73. package/dist/request/AuthenticationHeaderParser.mjs +1 -1
  74. package/dist/request/RequestParameterBuilder.mjs +1 -1
  75. package/dist/request/RequestValidator.mjs +1 -1
  76. package/dist/request/ScopeSet.mjs +1 -1
  77. package/dist/response/ResponseHandler.mjs +1 -1
  78. package/dist/telemetry/performance/PerformanceClient.mjs +1 -1
  79. package/dist/telemetry/performance/PerformanceEvent.d.ts +4 -0
  80. package/dist/telemetry/performance/PerformanceEvent.d.ts.map +1 -1
  81. package/dist/telemetry/performance/PerformanceEvent.mjs +1 -1
  82. package/dist/telemetry/performance/PerformanceEvent.mjs.map +1 -1
  83. package/dist/telemetry/performance/StubPerformanceClient.mjs +1 -1
  84. package/dist/telemetry/server/ServerTelemetryManager.mjs +1 -1
  85. package/dist/url/UrlString.mjs +1 -1
  86. package/dist/utils/ClientAssertionUtils.mjs +1 -1
  87. package/dist/utils/Constants.d.ts +6 -8
  88. package/dist/utils/Constants.d.ts.map +1 -1
  89. package/dist/utils/Constants.mjs +8 -10
  90. package/dist/utils/Constants.mjs.map +1 -1
  91. package/dist/utils/FunctionWrappers.mjs +1 -1
  92. package/dist/utils/ProtocolUtils.mjs +1 -1
  93. package/dist/utils/StringUtils.mjs +1 -1
  94. package/dist/utils/TimeUtils.mjs +1 -1
  95. package/dist/utils/UrlUtils.mjs +1 -1
  96. package/lib/index-browser.cjs +5 -81
  97. package/lib/index-browser.cjs.map +1 -1
  98. package/lib/{index-node-CnK83wp7.js → index-node-B6ITzmFz.js} +125 -53
  99. package/lib/index-node-B6ITzmFz.js.map +1 -0
  100. package/lib/index-node.cjs +3 -2
  101. package/lib/index-node.cjs.map +1 -1
  102. package/lib/index.cjs +4 -3
  103. package/lib/index.cjs.map +1 -1
  104. package/lib/types/authority/RegionDiscovery.d.ts.map +1 -1
  105. package/lib/types/cache/CacheManager.d.ts +7 -7
  106. package/lib/types/cache/CacheManager.d.ts.map +1 -1
  107. package/lib/types/cache/interface/ICacheManager.d.ts +4 -4
  108. package/lib/types/cache/interface/ICacheManager.d.ts.map +1 -1
  109. package/lib/types/client/SilentFlowClient.d.ts.map +1 -1
  110. package/lib/types/config/ClientConfiguration.d.ts.map +1 -1
  111. package/lib/types/crypto/ICrypto.d.ts +1 -1
  112. package/lib/types/crypto/ICrypto.d.ts.map +1 -1
  113. package/lib/types/error/InteractionRequiredAuthError.d.ts.map +1 -1
  114. package/lib/types/error/InteractionRequiredAuthErrorCodes.d.ts +1 -0
  115. package/lib/types/error/InteractionRequiredAuthErrorCodes.d.ts.map +1 -1
  116. package/lib/types/exports-common.d.ts +1 -1
  117. package/lib/types/exports-common.d.ts.map +1 -1
  118. package/lib/types/packageMetadata.d.ts +1 -1
  119. package/lib/types/telemetry/performance/PerformanceEvent.d.ts +4 -0
  120. package/lib/types/telemetry/performance/PerformanceEvent.d.ts.map +1 -1
  121. package/lib/types/utils/Constants.d.ts +6 -8
  122. package/lib/types/utils/Constants.d.ts.map +1 -1
  123. package/package.json +1 -1
  124. package/src/authority/RegionDiscovery.ts +5 -10
  125. package/src/cache/CacheManager.ts +44 -39
  126. package/src/cache/interface/ICacheManager.ts +4 -4
  127. package/src/client/SilentFlowClient.ts +1 -3
  128. package/src/config/ClientConfiguration.ts +3 -1
  129. package/src/crypto/ICrypto.ts +2 -2
  130. package/src/error/InteractionRequiredAuthError.ts +3 -0
  131. package/src/error/InteractionRequiredAuthErrorCodes.ts +1 -0
  132. package/src/exports-common.ts +1 -0
  133. package/src/packageMetadata.ts +1 -1
  134. package/src/telemetry/performance/PerformanceEvent.ts +5 -0
  135. package/src/utils/Constants.ts +7 -9
  136. package/lib/index-node-CnK83wp7.js.map +0 -1
@@ -197,19 +197,19 @@ export interface ICacheManager {
197
197
  /**
198
198
  * Removes all accounts and related tokens from cache.
199
199
  */
200
- removeAllAccounts(): Promise<void>;
200
+ removeAllAccounts(correlationId: string): void;
201
201
 
202
202
  /**
203
203
  * returns a boolean if the given account is removed
204
204
  * @param account
205
205
  */
206
- removeAccount(accountKey: string): Promise<void>;
206
+ removeAccount(accountKey: string, correlationId: string): void;
207
207
 
208
208
  /**
209
209
  * returns a boolean if the given account is removed
210
210
  * @param account
211
211
  */
212
- removeAccountContext(account: AccountEntity): Promise<void>;
212
+ removeAccountContext(account: AccountEntity, correlationId: string): void;
213
213
 
214
214
  /**
215
215
  * @param key
@@ -219,7 +219,7 @@ export interface ICacheManager {
219
219
  /**
220
220
  * @param key
221
221
  */
222
- removeAccessToken(key: string): Promise<void>;
222
+ removeAccessToken(key: string, correlationId: string): void;
223
223
 
224
224
  /**
225
225
  * @param key
@@ -75,9 +75,7 @@ export class SilentFlowClient extends BaseClient {
75
75
  request.account,
76
76
  request,
77
77
  tokenKeys,
78
- requestTenantId,
79
- this.performanceClient,
80
- request.correlationId
78
+ requestTenantId
81
79
  );
82
80
 
83
81
  if (!cachedAccessToken) {
@@ -23,6 +23,7 @@ import {
23
23
  ClientAuthErrorCodes,
24
24
  createClientAuthError,
25
25
  } from "../error/ClientAuthError.js";
26
+ import { StubPerformanceClient } from "../telemetry/performance/StubPerformanceClient.js";
26
27
 
27
28
  /**
28
29
  * Use the configuration object to configure MSAL Modules and initialize the base interfaces for MSAL.
@@ -260,7 +261,8 @@ export function buildClientConfiguration({
260
261
  new DefaultStorageClass(
261
262
  userAuthOptions.clientId,
262
263
  DEFAULT_CRYPTO_IMPLEMENTATION,
263
- new Logger(loggerOptions)
264
+ new Logger(loggerOptions),
265
+ new StubPerformanceClient()
264
266
  ),
265
267
  networkInterface:
266
268
  networkImplementation || DEFAULT_NETWORK_IMPLEMENTATION,
@@ -70,7 +70,7 @@ export interface ICrypto {
70
70
  * Removes cryptographic keypair from key store matching the keyId passed in
71
71
  * @param kid
72
72
  */
73
- removeTokenBindingKey(kid: string): Promise<boolean>;
73
+ removeTokenBindingKey(kid: string): Promise<void>;
74
74
  /**
75
75
  * Removes all cryptographic keys from IndexedDB storage
76
76
  */
@@ -111,7 +111,7 @@ export const DEFAULT_CRYPTO_IMPLEMENTATION: ICrypto = {
111
111
  async getPublicKeyThumbprint(): Promise<string> {
112
112
  throw createClientAuthError(ClientAuthErrorCodes.methodNotImplemented);
113
113
  },
114
- async removeTokenBindingKey(): Promise<boolean> {
114
+ async removeTokenBindingKey(): Promise<void> {
115
115
  throw createClientAuthError(ClientAuthErrorCodes.methodNotImplemented);
116
116
  },
117
117
  async clearKeystore(): Promise<boolean> {
@@ -16,6 +16,7 @@ export const InteractionRequiredServerErrorMessage = [
16
16
  InteractionRequiredAuthErrorCodes.consentRequired,
17
17
  InteractionRequiredAuthErrorCodes.loginRequired,
18
18
  InteractionRequiredAuthErrorCodes.badToken,
19
+ InteractionRequiredAuthErrorCodes.uxNotAllowed,
19
20
  ];
20
21
 
21
22
  export const InteractionRequiredAuthSubErrorMessage = [
@@ -36,6 +37,8 @@ const InteractionRequiredAuthErrorMessages = {
36
37
  "Refresh token has expired.",
37
38
  [InteractionRequiredAuthErrorCodes.badToken]:
38
39
  "Identity provider returned bad_token due to an expired or invalid refresh token. Please invoke an interactive API to resolve.",
40
+ [InteractionRequiredAuthErrorCodes.uxNotAllowed]:
41
+ "`canShowUI` flag in Edge was set to false. User interaction required on web page. Please invoke an interactive API to resolve.",
39
42
  };
40
43
 
41
44
  /**
@@ -7,6 +7,7 @@
7
7
  export const noTokensFound = "no_tokens_found";
8
8
  export const nativeAccountUnavailable = "native_account_unavailable";
9
9
  export const refreshTokenExpired = "refresh_token_expired";
10
+ export const uxNotAllowed = "ux_not_allowed";
10
11
 
11
12
  // Codes potentially returned by server
12
13
  export const interactionRequired = "interaction_required";
@@ -181,6 +181,7 @@ export {
181
181
  HttpStatus,
182
182
  DEFAULT_TOKEN_RENEWAL_OFFSET_SEC,
183
183
  JsonWebTokenTypes,
184
+ EncodingTypes,
184
185
  } from "./utils/Constants.js";
185
186
  export { StringUtils } from "./utils/StringUtils.js";
186
187
  export { StringDict } from "./utils/MsalTypes.js";
@@ -1,3 +1,3 @@
1
1
  /* eslint-disable header/header */
2
2
  export const name = "@azure/msal-common";
3
- export const version = "15.6.0";
3
+ export const version = "15.7.1";
@@ -703,6 +703,11 @@ export type PerformanceEvent = {
703
703
  */
704
704
  libraryVersion: string;
705
705
 
706
+ /**
707
+ * Version of the library used last. Used to track upgrades and downgrades
708
+ */
709
+ previousLibraryVersion?: string;
710
+
706
711
  /**
707
712
  * Whether the response is from a native component (e.g., WAM)
708
713
  *
@@ -326,15 +326,6 @@ export const PasswordGrantConstants = {
326
326
  export type PasswordGrantConstants =
327
327
  (typeof PasswordGrantConstants)[keyof typeof PasswordGrantConstants];
328
328
 
329
- /**
330
- * Response codes
331
- */
332
- export const ResponseCodes = {
333
- httpSuccess: 200,
334
- httpBadRequest: 400,
335
- } as const;
336
- export type ResponseCodes = (typeof ResponseCodes)[keyof typeof ResponseCodes];
337
-
338
329
  /**
339
330
  * Region Discovery Sources
340
331
  */
@@ -389,3 +380,10 @@ export const ONE_DAY_IN_MS = 86400000;
389
380
 
390
381
  // Token renewal offset default in seconds
391
382
  export const DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;
383
+
384
+ export const EncodingTypes = {
385
+ BASE64: "base64",
386
+ HEX: "hex",
387
+ UTF8: "utf-8",
388
+ } as const;
389
+ export type EncodingTypes = (typeof EncodingTypes)[keyof typeof EncodingTypes];