@azure/msal-browser 3.7.1 → 3.7.2-alpha.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 (115) hide show
  1. package/dist/app/IPublicClientApplication.mjs +1 -1
  2. package/dist/app/PublicClientApplication.mjs +1 -1
  3. package/dist/app/PublicClientNext.mjs +1 -1
  4. package/dist/broker/nativeBroker/NativeMessageHandler.mjs +1 -1
  5. package/dist/broker/nativeBroker/NativeStatusCodes.mjs +1 -1
  6. package/dist/cache/AsyncMemoryStorage.mjs +1 -1
  7. package/dist/cache/BrowserCacheManager.mjs +1 -1
  8. package/dist/cache/BrowserStorage.mjs +1 -1
  9. package/dist/cache/CryptoKeyStore.mjs +1 -1
  10. package/dist/cache/DatabaseStorage.mjs +1 -1
  11. package/dist/cache/MemoryStorage.mjs +1 -1
  12. package/dist/cache/TokenCache.mjs +1 -1
  13. package/dist/config/Configuration.mjs +1 -1
  14. package/dist/controllers/ControllerFactory.mjs +1 -1
  15. package/dist/controllers/NestedAppAuthController.mjs +1 -1
  16. package/dist/controllers/StandardController.mjs +1 -1
  17. package/dist/controllers/UnknownOperatingContextController.mjs +1 -1
  18. package/dist/crypto/BrowserCrypto.d.ts +6 -3
  19. package/dist/crypto/BrowserCrypto.d.ts.map +1 -1
  20. package/dist/crypto/BrowserCrypto.mjs +54 -5
  21. package/dist/crypto/BrowserCrypto.mjs.map +1 -1
  22. package/dist/crypto/CryptoOps.mjs +1 -1
  23. package/dist/crypto/PkceGenerator.mjs +1 -1
  24. package/dist/crypto/SignedHttpRequest.mjs +1 -1
  25. package/dist/encode/Base64Decode.mjs +1 -1
  26. package/dist/encode/Base64Encode.mjs +1 -1
  27. package/dist/error/BrowserAuthError.mjs +1 -1
  28. package/dist/error/BrowserAuthErrorCodes.mjs +1 -1
  29. package/dist/error/BrowserConfigurationAuthError.mjs +1 -1
  30. package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
  31. package/dist/error/NativeAuthError.mjs +1 -1
  32. package/dist/error/NativeAuthErrorCodes.mjs +1 -1
  33. package/dist/error/NestedAppAuthError.mjs +1 -1
  34. package/dist/event/EventHandler.d.ts.map +1 -1
  35. package/dist/event/EventHandler.mjs +8 -2
  36. package/dist/event/EventHandler.mjs.map +1 -1
  37. package/dist/event/EventMessage.mjs +1 -1
  38. package/dist/event/EventType.d.ts +1 -0
  39. package/dist/event/EventType.d.ts.map +1 -1
  40. package/dist/event/EventType.mjs +2 -1
  41. package/dist/event/EventType.mjs.map +1 -1
  42. package/dist/index.mjs +1 -1
  43. package/dist/interaction_client/BaseInteractionClient.d.ts +5 -4
  44. package/dist/interaction_client/BaseInteractionClient.d.ts.map +1 -1
  45. package/dist/interaction_client/BaseInteractionClient.mjs +19 -21
  46. package/dist/interaction_client/BaseInteractionClient.mjs.map +1 -1
  47. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
  48. package/dist/interaction_client/NativeInteractionClient.d.ts.map +1 -1
  49. package/dist/interaction_client/NativeInteractionClient.mjs +3 -2
  50. package/dist/interaction_client/NativeInteractionClient.mjs.map +1 -1
  51. package/dist/interaction_client/PopupClient.d.ts.map +1 -1
  52. package/dist/interaction_client/PopupClient.mjs +4 -3
  53. package/dist/interaction_client/PopupClient.mjs.map +1 -1
  54. package/dist/interaction_client/RedirectClient.d.ts.map +1 -1
  55. package/dist/interaction_client/RedirectClient.mjs +4 -3
  56. package/dist/interaction_client/RedirectClient.mjs.map +1 -1
  57. package/dist/interaction_client/SilentAuthCodeClient.d.ts.map +1 -1
  58. package/dist/interaction_client/SilentAuthCodeClient.mjs +2 -2
  59. package/dist/interaction_client/SilentAuthCodeClient.mjs.map +1 -1
  60. package/dist/interaction_client/SilentCacheClient.d.ts +1 -1
  61. package/dist/interaction_client/SilentCacheClient.d.ts.map +1 -1
  62. package/dist/interaction_client/SilentCacheClient.mjs +5 -5
  63. package/dist/interaction_client/SilentCacheClient.mjs.map +1 -1
  64. package/dist/interaction_client/SilentIframeClient.d.ts.map +1 -1
  65. package/dist/interaction_client/SilentIframeClient.mjs +2 -2
  66. package/dist/interaction_client/SilentIframeClient.mjs.map +1 -1
  67. package/dist/interaction_client/SilentRefreshClient.d.ts +2 -2
  68. package/dist/interaction_client/SilentRefreshClient.d.ts.map +1 -1
  69. package/dist/interaction_client/SilentRefreshClient.mjs +5 -5
  70. package/dist/interaction_client/SilentRefreshClient.mjs.map +1 -1
  71. package/dist/interaction_client/StandardInteractionClient.d.ts +3 -9
  72. package/dist/interaction_client/StandardInteractionClient.d.ts.map +1 -1
  73. package/dist/interaction_client/StandardInteractionClient.mjs +6 -29
  74. package/dist/interaction_client/StandardInteractionClient.mjs.map +1 -1
  75. package/dist/interaction_handler/InteractionHandler.mjs +1 -1
  76. package/dist/interaction_handler/RedirectHandler.mjs +1 -1
  77. package/dist/interaction_handler/SilentHandler.mjs +1 -1
  78. package/dist/naa/BridgeError.mjs +1 -1
  79. package/dist/naa/BridgeProxy.mjs +1 -1
  80. package/dist/naa/BridgeStatusCode.mjs +1 -1
  81. package/dist/naa/mapping/NestedAppAuthAdapter.mjs +1 -1
  82. package/dist/navigation/NavigationClient.mjs +1 -1
  83. package/dist/network/FetchClient.mjs +1 -1
  84. package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
  85. package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
  86. package/dist/operatingcontext/TeamsAppOperatingContext.mjs +1 -1
  87. package/dist/operatingcontext/UnknownOperatingContext.mjs +1 -1
  88. package/dist/packageMetadata.d.ts +1 -1
  89. package/dist/packageMetadata.d.ts.map +1 -1
  90. package/dist/packageMetadata.mjs +2 -2
  91. package/dist/response/ResponseHandler.mjs +1 -1
  92. package/dist/telemetry/BrowserPerformanceClient.mjs +1 -1
  93. package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
  94. package/dist/utils/BrowserConstants.mjs +1 -1
  95. package/dist/utils/BrowserProtocolUtils.mjs +1 -1
  96. package/dist/utils/BrowserUtils.mjs +1 -1
  97. package/lib/msal-browser.cjs +216 -187
  98. package/lib/msal-browser.cjs.map +1 -1
  99. package/lib/msal-browser.js +216 -187
  100. package/lib/msal-browser.js.map +1 -1
  101. package/lib/msal-browser.min.js +66 -65
  102. package/package.json +4 -4
  103. package/src/crypto/BrowserCrypto.ts +57 -4
  104. package/src/event/EventHandler.ts +8 -0
  105. package/src/event/EventType.ts +1 -0
  106. package/src/interaction_client/BaseInteractionClient.ts +40 -31
  107. package/src/interaction_client/NativeInteractionClient.ts +6 -1
  108. package/src/interaction_client/PopupClient.ts +8 -2
  109. package/src/interaction_client/RedirectClient.ts +8 -2
  110. package/src/interaction_client/SilentAuthCodeClient.ts +6 -1
  111. package/src/interaction_client/SilentCacheClient.ts +6 -4
  112. package/src/interaction_client/SilentIframeClient.ts +2 -1
  113. package/src/interaction_client/SilentRefreshClient.ts +7 -4
  114. package/src/interaction_client/StandardInteractionClient.ts +11 -57
  115. package/src/packageMetadata.ts +1 -1
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "type": "git",
11
11
  "url": "https://github.com/AzureAD/microsoft-authentication-library-for-js.git"
12
12
  },
13
- "version": "3.7.1",
13
+ "version": "3.7.2-alpha.1",
14
14
  "description": "Microsoft Authentication Library for js",
15
15
  "keywords": [
16
16
  "implicit",
@@ -85,11 +85,11 @@
85
85
  "@types/node": "^20.3.1",
86
86
  "@types/sinon": "^7.5.0",
87
87
  "dotenv": "^8.2.0",
88
- "eslint-config-msal": "^0.0.0",
89
- "msal-test-utils": "^0.0.1",
88
+ "eslint-config-msal": "file:../../shared-configs/eslint-config-msal",
90
89
  "fake-indexeddb": "^3.1.3",
91
90
  "jest": "^29.5.0",
92
91
  "jest-environment-jsdom": "^29.5.0",
92
+ "msal-test-utils": "file:../../shared-test-utils",
93
93
  "prettier": "2.8.7",
94
94
  "rimraf": "^3.0.0",
95
95
  "rollup": "^3.14.0",
@@ -101,6 +101,6 @@
101
101
  "typescript": "^4.9.5"
102
102
  },
103
103
  "dependencies": {
104
- "@azure/msal-common": "14.6.1"
104
+ "@azure/msal-common": "14.6.2-alpha.1"
105
105
  }
106
106
  }
@@ -30,6 +30,10 @@ const S256_HASH_ALG = "SHA-256";
30
30
  const MODULUS_LENGTH = 2048;
31
31
  // Public Exponent
32
32
  const PUBLIC_EXPONENT: Uint8Array = new Uint8Array([0x01, 0x00, 0x01]);
33
+ // UUID hex digits
34
+ const UUID_CHARS = "0123456789abcdef";
35
+ // Array to store UINT32 random value
36
+ const UINT32_ARR = new Uint32Array(1);
33
37
 
34
38
  const keygenAlgorithmOptions: RsaHashedKeyGenParams = {
35
39
  name: PKCS1_V15_KEYGEN_ALG,
@@ -52,7 +56,9 @@ export function validateCryptoAvailable(logger: Logger): void {
52
56
 
53
57
  /**
54
58
  * Returns a sha-256 hash of the given dataString as an ArrayBuffer.
55
- * @param dataString
59
+ * @param dataString {string} data string
60
+ * @param performanceClient {?IPerformanceClient}
61
+ * @param correlationId {?string} correlation id
56
62
  */
57
63
  export async function sha256Digest(
58
64
  dataString: string,
@@ -80,11 +86,58 @@ export function getRandomValues(dataBuffer: Uint8Array): Uint8Array {
80
86
  }
81
87
 
82
88
  /**
83
- * Creates a new random GUID
84
- * @returns
89
+ * Returns random Uint32 value.
90
+ * @returns {number}
91
+ */
92
+ function getRandomUint32(): number {
93
+ window.crypto.getRandomValues(UINT32_ARR);
94
+ return UINT32_ARR[0];
95
+ }
96
+
97
+ /**
98
+ * Creates a UUID v7 from the current timestamp.
99
+ * Implementation relies on the system clock to guarantee increasing order of generated identifiers.
100
+ * @returns {number}
85
101
  */
86
102
  export function createNewGuid(): string {
87
- return window.crypto.randomUUID();
103
+ const currentTimestamp = Date.now();
104
+ const baseRand = getRandomUint32() * 0x400 + (getRandomUint32() & 0x3ff);
105
+
106
+ // Result byte array
107
+ const bytes = new Uint8Array(16);
108
+ // A 12-bit `rand_a` field value
109
+ const randA = Math.trunc(baseRand / 2 ** 30);
110
+ // The higher 30 bits of 62-bit `rand_b` field value
111
+ const randBHi = baseRand & (2 ** 30 - 1);
112
+ // The lower 32 bits of 62-bit `rand_b` field value
113
+ const randBLo = getRandomUint32();
114
+
115
+ bytes[0] = currentTimestamp / 2 ** 40;
116
+ bytes[1] = currentTimestamp / 2 ** 32;
117
+ bytes[2] = currentTimestamp / 2 ** 24;
118
+ bytes[3] = currentTimestamp / 2 ** 16;
119
+ bytes[4] = currentTimestamp / 2 ** 8;
120
+ bytes[5] = currentTimestamp;
121
+ bytes[6] = 0x70 | (randA >>> 8);
122
+ bytes[7] = randA;
123
+ bytes[8] = 0x80 | (randBHi >>> 24);
124
+ bytes[9] = randBHi >>> 16;
125
+ bytes[10] = randBHi >>> 8;
126
+ bytes[11] = randBHi;
127
+ bytes[12] = randBLo >>> 24;
128
+ bytes[13] = randBLo >>> 16;
129
+ bytes[14] = randBLo >>> 8;
130
+ bytes[15] = randBLo;
131
+
132
+ let text = "";
133
+ for (let i = 0; i < bytes.length; i++) {
134
+ text += UUID_CHARS.charAt(bytes[i] >>> 4);
135
+ text += UUID_CHARS.charAt(bytes[i] & 0xf);
136
+ if (i === 3 || i === 5 || i === 7 || i === 9) {
137
+ text += "-";
138
+ }
139
+ }
140
+ return text;
88
141
  }
89
142
 
90
143
  /**
@@ -8,6 +8,7 @@ import {
8
8
  Logger,
9
9
  AccountEntity,
10
10
  CacheManager,
11
+ PersistentCacheKeys,
11
12
  } from "@azure/msal-common";
12
13
  import { InteractionType } from "../utils/BrowserConstants";
13
14
  import {
@@ -139,6 +140,13 @@ export class EventHandler {
139
140
  */
140
141
  private handleAccountCacheChange(e: StorageEvent): void {
141
142
  try {
143
+ // Handle active account filter change
144
+ if (e.key?.includes(PersistentCacheKeys.ACTIVE_ACCOUNT_FILTERS)) {
145
+ // This event has no payload, it only signals cross-tab app instances that the results of calling getActiveAccount() will have changed
146
+ this.emitEvent(EventType.ACTIVE_ACCOUNT_CHANGED);
147
+ }
148
+
149
+ // Handle account object change
142
150
  const cacheValue = e.newValue || e.oldValue;
143
151
  if (!cacheValue) {
144
152
  return;
@@ -8,6 +8,7 @@ export const EventType = {
8
8
  INITIALIZE_END: "msal:initializeEnd",
9
9
  ACCOUNT_ADDED: "msal:accountAdded",
10
10
  ACCOUNT_REMOVED: "msal:accountRemoved",
11
+ ACTIVE_ACCOUNT_CHANGED: "msal:activeAccountChanged",
11
12
  LOGIN_START: "msal:loginStart",
12
13
  LOGIN_SUCCESS: "msal:loginSuccess",
13
14
  LOGIN_FAILURE: "msal:loginFailure",
@@ -22,6 +22,8 @@ import {
22
22
  IPerformanceClient,
23
23
  PerformanceEvents,
24
24
  StringUtils,
25
+ AzureCloudOptions,
26
+ invokeAsync,
25
27
  } from "@azure/msal-common";
26
28
  import { BrowserConfiguration } from "../config/Configuration";
27
29
  import { BrowserCacheManager } from "../cache/BrowserCacheManager";
@@ -136,8 +138,7 @@ export abstract class BaseInteractionClient {
136
138
  * @param request
137
139
  */
138
140
  protected async initializeBaseRequest(
139
- request: Partial<BaseAuthRequest>,
140
- account?: AccountInfo
141
+ request: Partial<BaseAuthRequest>
141
142
  ): Promise<BaseAuthRequest> {
142
143
  this.performanceClient.addQueueMeasurement(
143
144
  PerformanceEvents.InitializeBaseRequest,
@@ -145,10 +146,6 @@ export abstract class BaseInteractionClient {
145
146
  );
146
147
  const authority = request.authority || this.config.auth.authority;
147
148
 
148
- if (account) {
149
- await this.validateRequestAuthority(authority, account);
150
- }
151
-
152
149
  const scopes = [...((request && request.scopes) || [])];
153
150
 
154
151
  const validatedRequest: BaseAuthRequest = {
@@ -218,25 +215,6 @@ export abstract class BaseInteractionClient {
218
215
  );
219
216
  }
220
217
 
221
- /*
222
- * If authority provided in the request does not match environment/authority specified
223
- * in the account or MSAL config, we throw an error.
224
- */
225
- async validateRequestAuthority(
226
- authority: string,
227
- account: AccountInfo
228
- ): Promise<void> {
229
- const discoveredAuthority = await this.getDiscoveredAuthority(
230
- authority
231
- );
232
-
233
- if (!discoveredAuthority.isAlias(account.environment)) {
234
- throw createClientConfigurationError(
235
- ClientConfigurationErrorCodes.authorityMismatch
236
- );
237
- }
238
- }
239
-
240
218
  /**
241
219
  *
242
220
  * @param apiId
@@ -266,23 +244,46 @@ export abstract class BaseInteractionClient {
266
244
  /**
267
245
  * Used to get a discovered version of the default authority.
268
246
  * @param requestAuthority
247
+ * @param requestAzureCloudOptions
248
+ * @param account
269
249
  */
270
250
  protected async getDiscoveredAuthority(
271
- requestAuthority?: string
251
+ requestAuthority?: string,
252
+ requestAzureCloudOptions?: AzureCloudOptions,
253
+ account?: AccountInfo
272
254
  ): Promise<Authority> {
273
- this.logger.verbose("getDiscoveredAuthority called");
255
+ this.performanceClient.addQueueMeasurement(
256
+ PerformanceEvents.StandardInteractionClientGetDiscoveredAuthority,
257
+ this.correlationId
258
+ );
274
259
  const authorityOptions: AuthorityOptions = {
275
260
  protocolMode: this.config.auth.protocolMode,
276
261
  OIDCOptions: this.config.auth.OIDCOptions,
277
262
  knownAuthorities: this.config.auth.knownAuthorities,
278
263
  cloudDiscoveryMetadata: this.config.auth.cloudDiscoveryMetadata,
279
264
  authorityMetadata: this.config.auth.authorityMetadata,
265
+ skipAuthorityMetadataCache:
266
+ this.config.auth.skipAuthorityMetadataCache,
280
267
  };
281
268
 
282
- const authority = requestAuthority || this.config.auth.authority;
283
- this.logger.verbose(`Creating discovered authority with ${authority}`);
284
- return AuthorityFactory.createDiscoveredInstance(
285
- authority,
269
+ // build authority string based on auth params, precedence - azureCloudInstance + tenant >> authority
270
+ const userAuthority = requestAuthority
271
+ ? requestAuthority
272
+ : this.config.auth.authority;
273
+
274
+ // fall back to the authority from config
275
+ const builtAuthority = Authority.generateAuthority(
276
+ userAuthority,
277
+ requestAzureCloudOptions || this.config.auth.azureCloudOptions
278
+ );
279
+ const discoveredAuthority = await invokeAsync(
280
+ AuthorityFactory.createDiscoveredInstance,
281
+ PerformanceEvents.AuthorityFactoryCreateDiscoveredInstance,
282
+ this.logger,
283
+ this.performanceClient,
284
+ this.correlationId
285
+ )(
286
+ builtAuthority,
286
287
  this.config.system.networkClient,
287
288
  this.browserStorage,
288
289
  authorityOptions,
@@ -290,5 +291,13 @@ export abstract class BaseInteractionClient {
290
291
  this.correlationId,
291
292
  this.performanceClient
292
293
  );
294
+
295
+ if (account && !discoveredAuthority.isAlias(account.environment)) {
296
+ throw createClientConfigurationError(
297
+ ClientConfigurationErrorCodes.authorityMismatch
298
+ );
299
+ }
300
+
301
+ return discoveredAuthority;
293
302
  }
294
303
  }
@@ -809,7 +809,12 @@ export class NativeInteractionClient extends BaseInteractionClient {
809
809
  const authority = request.authority || this.config.auth.authority;
810
810
 
811
811
  if (request.account) {
812
- await this.validateRequestAuthority(authority, request.account);
812
+ // validate authority
813
+ await this.getDiscoveredAuthority(
814
+ authority,
815
+ request.azureCloudOptions,
816
+ request.account
817
+ );
813
818
  }
814
819
 
815
820
  const canonicalAuthority = new UrlString(authority);
@@ -232,7 +232,8 @@ export class PopupClient extends StandardInteractionClient {
232
232
  )(
233
233
  serverTelemetryManager,
234
234
  validRequest.authority,
235
- validRequest.azureCloudOptions
235
+ validRequest.azureCloudOptions,
236
+ validRequest.account
236
237
  );
237
238
 
238
239
  const isNativeBroker = NativeMessageHandler.isNativeAvailable(
@@ -406,7 +407,12 @@ export class PopupClient extends StandardInteractionClient {
406
407
  this.logger,
407
408
  this.performanceClient,
408
409
  this.correlationId
409
- )(serverTelemetryManager, requestAuthority);
410
+ )(
411
+ serverTelemetryManager,
412
+ requestAuthority,
413
+ undefined, // AzureCloudOptions
414
+ validRequest.account || undefined
415
+ );
410
416
 
411
417
  try {
412
418
  authClient.authority.endSessionEndpoint;
@@ -136,7 +136,8 @@ export class RedirectClient extends StandardInteractionClient {
136
136
  )(
137
137
  serverTelemetryManager,
138
138
  validRequest.authority,
139
- validRequest.azureCloudOptions
139
+ validRequest.azureCloudOptions,
140
+ validRequest.account
140
141
  );
141
142
 
142
143
  // Create redirect interaction handler.
@@ -520,7 +521,12 @@ export class RedirectClient extends StandardInteractionClient {
520
521
  this.logger,
521
522
  this.performanceClient,
522
523
  this.correlationId
523
- )(serverTelemetryManager, logoutRequest && logoutRequest.authority);
524
+ )(
525
+ serverTelemetryManager,
526
+ logoutRequest && logoutRequest.authority,
527
+ undefined, // AzureCloudOptions
528
+ (logoutRequest && logoutRequest.account) || undefined
529
+ );
524
530
 
525
531
  if (authClient.authority.protocolMode === ProtocolMode.OIDC) {
526
532
  try {
@@ -99,7 +99,12 @@ export class SilentAuthCodeClient extends StandardInteractionClient {
99
99
  this.logger,
100
100
  this.performanceClient,
101
101
  request.correlationId
102
- )(serverTelemetryManager, silentRequest.authority);
102
+ )(
103
+ serverTelemetryManager,
104
+ silentRequest.authority,
105
+ silentRequest.azureCloudOptions,
106
+ silentRequest.account
107
+ );
103
108
  const authClient: HybridSpaAuthorizationCodeClient =
104
109
  new HybridSpaAuthorizationCodeClient(clientConfig);
105
110
  this.logger.verbose("Auth code client created");
@@ -42,7 +42,8 @@ export class SilentCacheClient extends StandardInteractionClient {
42
42
  const silentAuthClient = await this.createSilentFlowClient(
43
43
  serverTelemetryManager,
44
44
  silentRequest.authority,
45
- silentRequest.azureCloudOptions
45
+ silentRequest.azureCloudOptions,
46
+ silentRequest.account
46
47
  );
47
48
  this.logger.verbose("Silent auth client created");
48
49
 
@@ -94,7 +95,8 @@ export class SilentCacheClient extends StandardInteractionClient {
94
95
  protected async createSilentFlowClient(
95
96
  serverTelemetryManager: ServerTelemetryManager,
96
97
  authorityUrl?: string,
97
- azureCloudOptions?: AzureCloudOptions
98
+ azureCloudOptions?: AzureCloudOptions,
99
+ account?: AccountInfo
98
100
  ): Promise<SilentFlowClient> {
99
101
  // Create auth module.
100
102
  const clientConfig = await invokeAsync(
@@ -103,7 +105,7 @@ export class SilentCacheClient extends StandardInteractionClient {
103
105
  this.logger,
104
106
  this.performanceClient,
105
107
  this.correlationId
106
- )(serverTelemetryManager, authorityUrl, azureCloudOptions);
108
+ )(serverTelemetryManager, authorityUrl, azureCloudOptions, account);
107
109
  return new SilentFlowClient(clientConfig, this.performanceClient);
108
110
  }
109
111
 
@@ -122,7 +124,7 @@ export class SilentCacheClient extends StandardInteractionClient {
122
124
  this.logger,
123
125
  this.performanceClient,
124
126
  this.correlationId
125
- )(request, account);
127
+ )(request);
126
128
  return {
127
129
  ...request,
128
130
  ...baseRequest,
@@ -135,7 +135,8 @@ export class SilentIframeClient extends StandardInteractionClient {
135
135
  )(
136
136
  serverTelemetryManager,
137
137
  silentRequest.authority,
138
- silentRequest.azureCloudOptions
138
+ silentRequest.azureCloudOptions,
139
+ silentRequest.account
139
140
  );
140
141
 
141
142
  return await invokeAsync(
@@ -12,6 +12,7 @@ import {
12
12
  AzureCloudOptions,
13
13
  PerformanceEvents,
14
14
  invokeAsync,
15
+ AccountInfo,
15
16
  } from "@azure/msal-common";
16
17
  import { ApiId } from "../utils/BrowserConstants";
17
18
  import {
@@ -39,7 +40,7 @@ export class SilentRefreshClient extends StandardInteractionClient {
39
40
  this.logger,
40
41
  this.performanceClient,
41
42
  request.correlationId
42
- )(request, request.account);
43
+ )(request);
43
44
  const silentRequest: CommonSilentFlowRequest = {
44
45
  ...request,
45
46
  ...baseRequest,
@@ -59,7 +60,8 @@ export class SilentRefreshClient extends StandardInteractionClient {
59
60
  const refreshTokenClient = await this.createRefreshTokenClient(
60
61
  serverTelemetryManager,
61
62
  silentRequest.authority,
62
- silentRequest.azureCloudOptions
63
+ silentRequest.azureCloudOptions,
64
+ silentRequest.account
63
65
  );
64
66
  // Send request to renew token. Auth module will throw errors if token cannot be renewed.
65
67
  return invokeAsync(
@@ -97,7 +99,8 @@ export class SilentRefreshClient extends StandardInteractionClient {
97
99
  protected async createRefreshTokenClient(
98
100
  serverTelemetryManager: ServerTelemetryManager,
99
101
  authorityUrl?: string,
100
- azureCloudOptions?: AzureCloudOptions
102
+ azureCloudOptions?: AzureCloudOptions,
103
+ account?: AccountInfo
101
104
  ): Promise<RefreshTokenClient> {
102
105
  // Create auth module.
103
106
  const clientConfig = await invokeAsync(
@@ -106,7 +109,7 @@ export class SilentRefreshClient extends StandardInteractionClient {
106
109
  this.logger,
107
110
  this.performanceClient,
108
111
  this.correlationId
109
- )(serverTelemetryManager, authorityUrl, azureCloudOptions);
112
+ )(serverTelemetryManager, authorityUrl, azureCloudOptions, account);
110
113
  return new RefreshTokenClient(clientConfig, this.performanceClient);
111
114
  }
112
115
  }
@@ -9,9 +9,6 @@ import {
9
9
  Constants,
10
10
  AuthorizationCodeClient,
11
11
  ClientConfiguration,
12
- AuthorityOptions,
13
- Authority,
14
- AuthorityFactory,
15
12
  UrlString,
16
13
  CommonEndSessionRequest,
17
14
  ProtocolUtils,
@@ -207,7 +204,8 @@ export abstract class StandardInteractionClient extends BaseInteractionClient {
207
204
  protected async createAuthCodeClient(
208
205
  serverTelemetryManager: ServerTelemetryManager,
209
206
  authorityUrl?: string,
210
- requestAzureCloudOptions?: AzureCloudOptions
207
+ requestAzureCloudOptions?: AzureCloudOptions,
208
+ account?: AccountInfo
211
209
  ): Promise<AuthorizationCodeClient> {
212
210
  this.performanceClient.addQueueMeasurement(
213
211
  PerformanceEvents.StandardInteractionClientCreateAuthCodeClient,
@@ -220,7 +218,12 @@ export abstract class StandardInteractionClient extends BaseInteractionClient {
220
218
  this.logger,
221
219
  this.performanceClient,
222
220
  this.correlationId
223
- )(serverTelemetryManager, authorityUrl, requestAzureCloudOptions);
221
+ )(
222
+ serverTelemetryManager,
223
+ authorityUrl,
224
+ requestAzureCloudOptions,
225
+ account
226
+ );
224
227
  return new AuthorizationCodeClient(
225
228
  clientConfig,
226
229
  this.performanceClient
@@ -236,7 +239,8 @@ export abstract class StandardInteractionClient extends BaseInteractionClient {
236
239
  protected async getClientConfiguration(
237
240
  serverTelemetryManager: ServerTelemetryManager,
238
241
  requestAuthority?: string,
239
- requestAzureCloudOptions?: AzureCloudOptions
242
+ requestAzureCloudOptions?: AzureCloudOptions,
243
+ account?: AccountInfo
240
244
  ): Promise<ClientConfiguration> {
241
245
  this.performanceClient.addQueueMeasurement(
242
246
  PerformanceEvents.StandardInteractionClientGetClientConfiguration,
@@ -248,7 +252,7 @@ export abstract class StandardInteractionClient extends BaseInteractionClient {
248
252
  this.logger,
249
253
  this.performanceClient,
250
254
  this.correlationId
251
- )(requestAuthority, requestAzureCloudOptions);
255
+ )(requestAuthority, requestAzureCloudOptions, account);
252
256
  const logger = this.config.system.loggerOptions;
253
257
 
254
258
  return {
@@ -286,56 +290,6 @@ export abstract class StandardInteractionClient extends BaseInteractionClient {
286
290
  };
287
291
  }
288
292
 
289
- /**
290
- * Used to get a discovered version of the default authority.
291
- * @param requestAuthority
292
- * @param requestCorrelationId
293
- */
294
- protected async getDiscoveredAuthority(
295
- requestAuthority?: string,
296
- requestAzureCloudOptions?: AzureCloudOptions
297
- ): Promise<Authority> {
298
- this.performanceClient.addQueueMeasurement(
299
- PerformanceEvents.StandardInteractionClientGetDiscoveredAuthority,
300
- this.correlationId
301
- );
302
- const authorityOptions: AuthorityOptions = {
303
- protocolMode: this.config.auth.protocolMode,
304
- OIDCOptions: this.config.auth.OIDCOptions,
305
- knownAuthorities: this.config.auth.knownAuthorities,
306
- cloudDiscoveryMetadata: this.config.auth.cloudDiscoveryMetadata,
307
- authorityMetadata: this.config.auth.authorityMetadata,
308
- skipAuthorityMetadataCache:
309
- this.config.auth.skipAuthorityMetadataCache,
310
- };
311
-
312
- // build authority string based on auth params, precedence - azureCloudInstance + tenant >> authority
313
- const userAuthority = requestAuthority
314
- ? requestAuthority
315
- : this.config.auth.authority;
316
-
317
- // fall back to the authority from config
318
- const builtAuthority = Authority.generateAuthority(
319
- userAuthority,
320
- requestAzureCloudOptions || this.config.auth.azureCloudOptions
321
- );
322
- return invokeAsync(
323
- AuthorityFactory.createDiscoveredInstance.bind(AuthorityFactory),
324
- PerformanceEvents.AuthorityFactoryCreateDiscoveredInstance,
325
- this.logger,
326
- this.performanceClient,
327
- this.correlationId
328
- )(
329
- builtAuthority,
330
- this.config.system.networkClient,
331
- this.browserStorage,
332
- authorityOptions,
333
- this.logger,
334
- this.correlationId,
335
- this.performanceClient
336
- );
337
- }
338
-
339
293
  /**
340
294
  * Helper to initialize required request parameters for interactive APIs and ssoSilent()
341
295
  * @param request
@@ -1,3 +1,3 @@
1
1
  /* eslint-disable header/header */
2
2
  export const name = "@azure/msal-browser";
3
- export const version = "3.7.1";
3
+ export const version = "3.7.2-alpha.1";