@azure/msal-browser 3.9.0 → 3.10.0
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.
- package/dist/app/IPublicClientApplication.mjs +1 -1
- package/dist/app/PublicClientApplication.mjs +1 -1
- package/dist/app/PublicClientNext.mjs +1 -1
- package/dist/broker/nativeBroker/NativeMessageHandler.mjs +1 -1
- package/dist/broker/nativeBroker/NativeStatusCodes.mjs +1 -1
- package/dist/cache/AsyncMemoryStorage.mjs +1 -1
- package/dist/cache/BrowserCacheManager.mjs +1 -1
- package/dist/cache/BrowserStorage.mjs +1 -1
- package/dist/cache/CryptoKeyStore.mjs +1 -1
- package/dist/cache/DatabaseStorage.mjs +1 -1
- package/dist/cache/MemoryStorage.mjs +1 -1
- package/dist/cache/TokenCache.mjs +1 -1
- package/dist/config/Configuration.mjs +1 -1
- package/dist/controllers/ControllerFactory.mjs +1 -1
- package/dist/controllers/NestedAppAuthController.mjs +1 -1
- package/dist/controllers/StandardController.mjs +1 -1
- package/dist/controllers/UnknownOperatingContextController.mjs +1 -1
- package/dist/crypto/BrowserCrypto.mjs +1 -1
- package/dist/crypto/CryptoOps.mjs +1 -1
- package/dist/crypto/PkceGenerator.mjs +1 -1
- package/dist/crypto/SignedHttpRequest.mjs +1 -1
- package/dist/encode/Base64Decode.mjs +1 -1
- package/dist/encode/Base64Encode.mjs +1 -1
- package/dist/error/BrowserAuthError.mjs +1 -1
- package/dist/error/BrowserAuthErrorCodes.mjs +1 -1
- package/dist/error/BrowserConfigurationAuthError.mjs +1 -1
- package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
- package/dist/error/NativeAuthError.mjs +1 -1
- package/dist/error/NativeAuthErrorCodes.mjs +1 -1
- package/dist/error/NestedAppAuthError.mjs +1 -1
- package/dist/event/EventHandler.mjs +1 -1
- package/dist/event/EventMessage.mjs +1 -1
- package/dist/event/EventType.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/interaction_client/BaseInteractionClient.mjs +1 -1
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
- package/dist/interaction_client/NativeInteractionClient.d.ts.map +1 -1
- package/dist/interaction_client/NativeInteractionClient.mjs +18 -6
- package/dist/interaction_client/NativeInteractionClient.mjs.map +1 -1
- package/dist/interaction_client/PopupClient.mjs +1 -1
- package/dist/interaction_client/RedirectClient.mjs +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.mjs +1 -1
- package/dist/interaction_client/SilentCacheClient.mjs +1 -1
- package/dist/interaction_client/SilentIframeClient.d.ts.map +1 -1
- package/dist/interaction_client/SilentIframeClient.mjs +14 -11
- package/dist/interaction_client/SilentIframeClient.mjs.map +1 -1
- package/dist/interaction_client/SilentRefreshClient.mjs +1 -1
- package/dist/interaction_client/StandardInteractionClient.mjs +1 -1
- package/dist/interaction_handler/InteractionHandler.mjs +1 -1
- package/dist/interaction_handler/RedirectHandler.mjs +1 -1
- package/dist/interaction_handler/SilentHandler.mjs +1 -1
- package/dist/naa/BridgeError.mjs +1 -1
- package/dist/naa/BridgeProxy.mjs +1 -1
- package/dist/naa/BridgeStatusCode.mjs +1 -1
- package/dist/naa/mapping/NestedAppAuthAdapter.mjs +1 -1
- package/dist/navigation/NavigationClient.mjs +1 -1
- package/dist/network/FetchClient.mjs +1 -1
- package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
- package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
- package/dist/operatingcontext/TeamsAppOperatingContext.mjs +1 -1
- package/dist/operatingcontext/UnknownOperatingContext.mjs +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.d.ts.map +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/response/ResponseHandler.mjs +1 -1
- package/dist/telemetry/BrowserPerformanceClient.d.ts.map +1 -1
- package/dist/telemetry/BrowserPerformanceClient.mjs +3 -2
- package/dist/telemetry/BrowserPerformanceClient.mjs.map +1 -1
- package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
- package/dist/utils/BrowserConstants.mjs +1 -1
- package/dist/utils/BrowserProtocolUtils.mjs +1 -1
- package/dist/utils/BrowserUtils.d.ts +5 -0
- package/dist/utils/BrowserUtils.d.ts.map +1 -1
- package/dist/utils/BrowserUtils.mjs +10 -2
- package/dist/utils/BrowserUtils.mjs.map +1 -1
- package/lib/msal-browser.cjs +252 -226
- package/lib/msal-browser.cjs.map +1 -1
- package/lib/msal-browser.js +252 -226
- package/lib/msal-browser.js.map +1 -1
- package/lib/msal-browser.min.js +58 -58
- package/package.json +2 -2
- package/src/interaction_client/NativeInteractionClient.ts +28 -9
- package/src/interaction_client/SilentIframeClient.ts +15 -16
- package/src/packageMetadata.ts +1 -1
- package/src/telemetry/BrowserPerformanceClient.ts +2 -1
- package/src/utils/BrowserUtils.ts +9 -0
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.
|
|
13
|
+
"version": "3.10.0",
|
|
14
14
|
"description": "Microsoft Authentication Library for js",
|
|
15
15
|
"keywords": [
|
|
16
16
|
"implicit",
|
|
@@ -101,6 +101,6 @@
|
|
|
101
101
|
"typescript": "^4.9.5"
|
|
102
102
|
},
|
|
103
103
|
"dependencies": {
|
|
104
|
-
"@azure/msal-common": "14.7.
|
|
104
|
+
"@azure/msal-common": "14.7.1"
|
|
105
105
|
}
|
|
106
106
|
}
|
|
@@ -262,6 +262,7 @@ export class NativeInteractionClient extends BaseInteractionClient {
|
|
|
262
262
|
const fullAccount = {
|
|
263
263
|
...account,
|
|
264
264
|
idTokenClaims: result?.idTokenClaims as TokenClaims,
|
|
265
|
+
idToken: result?.idToken,
|
|
265
266
|
};
|
|
266
267
|
|
|
267
268
|
return {
|
|
@@ -416,24 +417,33 @@ export class NativeInteractionClient extends BaseInteractionClient {
|
|
|
416
417
|
"NativeInteractionClient - handleNativeResponse called."
|
|
417
418
|
);
|
|
418
419
|
|
|
419
|
-
if (response.account.id !== request.accountId) {
|
|
420
|
-
// User switch in native broker prompt is not supported. All users must first sign in through web flow to ensure server state is in sync
|
|
421
|
-
throw createNativeAuthError(NativeAuthErrorCodes.userSwitch);
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
// Get the preferred_cache domain for the given authority
|
|
425
|
-
const authority = await this.getDiscoveredAuthority(request.authority);
|
|
426
|
-
|
|
427
420
|
// generate identifiers
|
|
428
421
|
const idTokenClaims = AuthToken.extractTokenClaims(
|
|
429
422
|
response.id_token,
|
|
430
423
|
base64Decode
|
|
431
424
|
);
|
|
425
|
+
|
|
432
426
|
const homeAccountIdentifier = this.createHomeAccountIdentifier(
|
|
433
427
|
response,
|
|
434
428
|
idTokenClaims
|
|
435
429
|
);
|
|
436
430
|
|
|
431
|
+
const cachedhomeAccountId =
|
|
432
|
+
this.browserStorage.getAccountInfoFilteredBy({
|
|
433
|
+
nativeAccountId: request.accountId,
|
|
434
|
+
})?.homeAccountId;
|
|
435
|
+
|
|
436
|
+
if (
|
|
437
|
+
homeAccountIdentifier !== cachedhomeAccountId &&
|
|
438
|
+
response.account.id !== request.accountId
|
|
439
|
+
) {
|
|
440
|
+
// User switch in native broker prompt is not supported. All users must first sign in through web flow to ensure server state is in sync
|
|
441
|
+
throw createNativeAuthError(NativeAuthErrorCodes.userSwitch);
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
// Get the preferred_cache domain for the given authority
|
|
445
|
+
const authority = await this.getDiscoveredAuthority(request.authority);
|
|
446
|
+
|
|
437
447
|
const baseAccount = buildAccountToCache(
|
|
438
448
|
this.browserStorage,
|
|
439
449
|
authority,
|
|
@@ -601,9 +611,18 @@ export class NativeInteractionClient extends BaseInteractionClient {
|
|
|
601
611
|
const accountInfo: AccountInfo | null = updateAccountTenantProfileData(
|
|
602
612
|
accountEntity.getAccountInfo(),
|
|
603
613
|
undefined, // tenantProfile optional
|
|
604
|
-
idTokenClaims
|
|
614
|
+
idTokenClaims,
|
|
615
|
+
response.id_token
|
|
605
616
|
);
|
|
606
617
|
|
|
618
|
+
/**
|
|
619
|
+
* In pairwise broker flows, this check prevents the broker's native account id
|
|
620
|
+
* from being returned over the embedded app's account id.
|
|
621
|
+
*/
|
|
622
|
+
if (accountInfo.nativeAccountId !== response.account.id) {
|
|
623
|
+
accountInfo.nativeAccountId = response.account.id;
|
|
624
|
+
}
|
|
625
|
+
|
|
607
626
|
// generate PoP token as needed
|
|
608
627
|
const responseAccessToken = await this.generatePopAccessToken(
|
|
609
628
|
response,
|
|
@@ -93,15 +93,20 @@ export class SilentIframeClient extends StandardInteractionClient {
|
|
|
93
93
|
);
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
// Check
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
96
|
+
// Check the prompt value
|
|
97
|
+
const inputRequest = { ...request };
|
|
98
|
+
if (inputRequest.prompt) {
|
|
99
|
+
if (
|
|
100
|
+
inputRequest.prompt !== PromptValue.NONE &&
|
|
101
|
+
inputRequest.prompt !== PromptValue.NO_SESSION
|
|
102
|
+
) {
|
|
103
|
+
this.logger.warning(
|
|
104
|
+
`SilentIframeClient. Replacing invalid prompt ${inputRequest.prompt} with ${PromptValue.NONE}`
|
|
105
|
+
);
|
|
106
|
+
inputRequest.prompt = PromptValue.NONE;
|
|
107
|
+
}
|
|
108
|
+
} else {
|
|
109
|
+
inputRequest.prompt = PromptValue.NONE;
|
|
105
110
|
}
|
|
106
111
|
|
|
107
112
|
// Create silent request
|
|
@@ -111,13 +116,7 @@ export class SilentIframeClient extends StandardInteractionClient {
|
|
|
111
116
|
this.logger,
|
|
112
117
|
this.performanceClient,
|
|
113
118
|
request.correlationId
|
|
114
|
-
)(
|
|
115
|
-
{
|
|
116
|
-
...request,
|
|
117
|
-
prompt: request.prompt || PromptValue.NONE,
|
|
118
|
-
},
|
|
119
|
-
InteractionType.Silent
|
|
120
|
-
);
|
|
119
|
+
)(inputRequest, InteractionType.Silent);
|
|
121
120
|
BrowserUtils.preconnect(silentRequest.authority);
|
|
122
121
|
|
|
123
122
|
const serverTelemetryManager = this.initializeServerTelemetryManager(
|
package/src/packageMetadata.ts
CHANGED
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
BROWSER_PERF_ENABLED_KEY,
|
|
21
21
|
BrowserCacheLocation,
|
|
22
22
|
} from "../utils/BrowserConstants";
|
|
23
|
+
import * as BrowserCrypto from "../crypto/BrowserCrypto";
|
|
23
24
|
|
|
24
25
|
/**
|
|
25
26
|
* Returns browser performance measurement module if session flag is enabled. Returns undefined otherwise.
|
|
@@ -88,7 +89,7 @@ export class BrowserPerformanceClient
|
|
|
88
89
|
}
|
|
89
90
|
|
|
90
91
|
generateId(): string {
|
|
91
|
-
return
|
|
92
|
+
return BrowserCrypto.createNewGuid();
|
|
92
93
|
}
|
|
93
94
|
|
|
94
95
|
private getPageVisibility(): string | null {
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
BrowserAuthErrorCodes,
|
|
10
10
|
} from "../error/BrowserAuthError";
|
|
11
11
|
import { InteractionType, BrowserConstants } from "./BrowserConstants";
|
|
12
|
+
import * as BrowserCrypto from "../crypto/BrowserCrypto";
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* Clears hash from window url.
|
|
@@ -162,3 +163,11 @@ export function preconnect(authority: string): void {
|
|
|
162
163
|
} catch {}
|
|
163
164
|
}, 10000); // 10s Timeout
|
|
164
165
|
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Wrapper function that creates a UUID v7 from the current timestamp.
|
|
169
|
+
* @returns {string}
|
|
170
|
+
*/
|
|
171
|
+
export function createGuid(): string {
|
|
172
|
+
return BrowserCrypto.createNewGuid();
|
|
173
|
+
}
|