@azure/msal-browser 3.16.0 → 3.18.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/NativeRequest.d.ts +1 -0
- package/dist/broker/nativeBroker/NativeRequest.d.ts.map +1 -1
- package/dist/broker/nativeBroker/NativeStatusCodes.mjs +1 -1
- package/dist/cache/AccountManager.mjs +1 -1
- package/dist/cache/AsyncMemoryStorage.mjs +1 -1
- package/dist/cache/BrowserCacheManager.d.ts.map +1 -1
- package/dist/cache/BrowserCacheManager.mjs +6 -3
- package/dist/cache/BrowserCacheManager.mjs.map +1 -1
- package/dist/cache/BrowserStorage.mjs +1 -1
- package/dist/cache/DatabaseStorage.mjs +1 -1
- package/dist/cache/MemoryStorage.mjs +1 -1
- package/dist/cache/TokenCache.d.ts.map +1 -1
- package/dist/cache/TokenCache.mjs +90 -117
- package/dist/cache/TokenCache.mjs.map +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.d.ts.map +1 -1
- package/dist/controllers/StandardController.mjs +4 -3
- package/dist/controllers/StandardController.mjs.map +1 -1
- package/dist/controllers/UnknownOperatingContextController.mjs +1 -1
- package/dist/crypto/BrowserCrypto.mjs +1 -1
- package/dist/crypto/CryptoOps.d.ts +11 -0
- package/dist/crypto/CryptoOps.d.ts.map +1 -1
- package/dist/crypto/CryptoOps.mjs +16 -1
- package/dist/crypto/CryptoOps.mjs.map +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.d.ts +5 -0
- package/dist/error/BrowserAuthError.d.ts.map +1 -1
- package/dist/error/BrowserAuthError.mjs +7 -2
- package/dist/error/BrowserAuthError.mjs.map +1 -1
- package/dist/error/BrowserAuthErrorCodes.d.ts +1 -0
- package/dist/error/BrowserAuthErrorCodes.d.ts.map +1 -1
- package/dist/error/BrowserAuthErrorCodes.mjs +3 -2
- package/dist/error/BrowserAuthErrorCodes.mjs.map +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 +2 -2
- package/dist/error/NestedAppAuthError.mjs.map +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 +36 -15
- 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.mjs +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/NestedAppOperatingContext.mjs +1 -1
- package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
- package/dist/operatingcontext/UnknownOperatingContext.mjs +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/request/RequestHelpers.mjs +1 -1
- package/dist/response/ResponseHandler.mjs +1 -1
- package/dist/telemetry/BrowserPerformanceClient.mjs +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.mjs +1 -1
- package/lib/msal-browser.cjs +283 -254
- package/lib/msal-browser.cjs.map +1 -1
- package/lib/msal-browser.js +283 -254
- package/lib/msal-browser.js.map +1 -1
- package/lib/msal-browser.min.js +63 -64
- package/package.json +3 -2
- package/src/broker/nativeBroker/NativeRequest.ts +1 -0
- package/src/cache/BrowserCacheManager.ts +4 -5
- package/src/cache/TokenCache.ts +158 -243
- package/src/controllers/StandardController.ts +6 -5
- package/src/crypto/CryptoOps.ts +17 -0
- package/src/error/BrowserAuthError.ts +8 -0
- package/src/error/BrowserAuthErrorCodes.ts +1 -0
- package/src/error/NestedAppAuthError.ts +1 -1
- package/src/interaction_client/NativeInteractionClient.ts +52 -23
- package/src/packageMetadata.ts +1 -1
|
@@ -25,7 +25,6 @@ import {
|
|
|
25
25
|
AuthError,
|
|
26
26
|
CommonSilentFlowRequest,
|
|
27
27
|
AccountInfo,
|
|
28
|
-
CacheRecord,
|
|
29
28
|
AADServerParamKeys,
|
|
30
29
|
TokenClaims,
|
|
31
30
|
createClientAuthError,
|
|
@@ -170,10 +169,12 @@ export class NativeInteractionClient extends BaseInteractionClient {
|
|
|
170
169
|
);
|
|
171
170
|
}
|
|
172
171
|
|
|
172
|
+
const { ...nativeTokenRequest } = nativeRequest;
|
|
173
|
+
|
|
173
174
|
// fall back to native calls
|
|
174
175
|
const messageBody: NativeExtensionRequestBody = {
|
|
175
176
|
method: NativeExtensionMethod.GetToken,
|
|
176
|
-
request:
|
|
177
|
+
request: nativeTokenRequest,
|
|
177
178
|
};
|
|
178
179
|
|
|
179
180
|
const response: object = await this.nativeMessageHandler.sendMessage(
|
|
@@ -289,9 +290,11 @@ export class NativeInteractionClient extends BaseInteractionClient {
|
|
|
289
290
|
);
|
|
290
291
|
const nativeRequest = await this.initializeNativeRequest(request);
|
|
291
292
|
|
|
293
|
+
const { ...nativeTokenRequest } = nativeRequest;
|
|
294
|
+
|
|
292
295
|
const messageBody: NativeExtensionRequestBody = {
|
|
293
296
|
method: NativeExtensionMethod.GetToken,
|
|
294
|
-
request:
|
|
297
|
+
request: nativeTokenRequest,
|
|
295
298
|
};
|
|
296
299
|
|
|
297
300
|
try {
|
|
@@ -454,8 +457,8 @@ export class NativeInteractionClient extends BaseInteractionClient {
|
|
|
454
457
|
this.browserStorage,
|
|
455
458
|
authority,
|
|
456
459
|
homeAccountIdentifier,
|
|
457
|
-
idTokenClaims,
|
|
458
460
|
base64Decode,
|
|
461
|
+
idTokenClaims,
|
|
459
462
|
response.client_info,
|
|
460
463
|
undefined, // environment
|
|
461
464
|
idTokenClaims.tid,
|
|
@@ -481,7 +484,7 @@ export class NativeInteractionClient extends BaseInteractionClient {
|
|
|
481
484
|
request,
|
|
482
485
|
homeAccountIdentifier,
|
|
483
486
|
idTokenClaims,
|
|
484
|
-
|
|
487
|
+
response.access_token,
|
|
485
488
|
result.tenantId,
|
|
486
489
|
reqTimestamp
|
|
487
490
|
);
|
|
@@ -535,7 +538,10 @@ export class NativeInteractionClient extends BaseInteractionClient {
|
|
|
535
538
|
response: NativeResponse,
|
|
536
539
|
request: NativeTokenRequest
|
|
537
540
|
): Promise<string> {
|
|
538
|
-
if (
|
|
541
|
+
if (
|
|
542
|
+
request.tokenType === AuthenticationScheme.POP &&
|
|
543
|
+
request.signPopToken
|
|
544
|
+
) {
|
|
539
545
|
/**
|
|
540
546
|
* This code prioritizes SHR returned from the native layer. In case of error/SHR not calculated from WAM and the AT
|
|
541
547
|
* is still received, SHR is calculated locally
|
|
@@ -725,14 +731,17 @@ export class NativeInteractionClient extends BaseInteractionClient {
|
|
|
725
731
|
responseScopes.printScopes(),
|
|
726
732
|
tokenExpirationSeconds,
|
|
727
733
|
0,
|
|
728
|
-
base64Decode
|
|
734
|
+
base64Decode,
|
|
735
|
+
undefined,
|
|
736
|
+
request.tokenType as AuthenticationScheme,
|
|
737
|
+
undefined,
|
|
738
|
+
request.keyId
|
|
729
739
|
);
|
|
730
740
|
|
|
731
|
-
const nativeCacheRecord =
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
);
|
|
741
|
+
const nativeCacheRecord = {
|
|
742
|
+
idToken: cachedIdToken,
|
|
743
|
+
accessToken: cachedAccessToken,
|
|
744
|
+
};
|
|
736
745
|
|
|
737
746
|
void this.nativeStorageManager.saveCacheRecord(
|
|
738
747
|
nativeCacheRecord,
|
|
@@ -917,8 +926,16 @@ export class NativeInteractionClient extends BaseInteractionClient {
|
|
|
917
926
|
...request.tokenQueryParameters,
|
|
918
927
|
},
|
|
919
928
|
extendedExpiryToken: false, // Make this configurable?
|
|
929
|
+
keyId: request.popKid,
|
|
920
930
|
};
|
|
921
931
|
|
|
932
|
+
// Check for PoP token requests: signPopToken should only be set to true if popKid is not set
|
|
933
|
+
if (validatedRequest.signPopToken && !!request.popKid) {
|
|
934
|
+
throw createBrowserAuthError(
|
|
935
|
+
BrowserAuthErrorCodes.invalidPopTokenRequest
|
|
936
|
+
);
|
|
937
|
+
}
|
|
938
|
+
|
|
922
939
|
this.handleExtraBrokerParams(validatedRequest);
|
|
923
940
|
validatedRequest.extraParameters =
|
|
924
941
|
validatedRequest.extraParameters || {};
|
|
@@ -935,17 +952,29 @@ export class NativeInteractionClient extends BaseInteractionClient {
|
|
|
935
952
|
};
|
|
936
953
|
|
|
937
954
|
const popTokenGenerator = new PopTokenGenerator(this.browserCrypto);
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
955
|
+
|
|
956
|
+
// generate reqCnf if not provided in the request
|
|
957
|
+
let reqCnfData;
|
|
958
|
+
if (!validatedRequest.keyId) {
|
|
959
|
+
const generatedReqCnfData = await invokeAsync(
|
|
960
|
+
popTokenGenerator.generateCnf.bind(popTokenGenerator),
|
|
961
|
+
PerformanceEvents.PopTokenGenerateCnf,
|
|
962
|
+
this.logger,
|
|
963
|
+
this.performanceClient,
|
|
964
|
+
request.correlationId
|
|
965
|
+
)(shrParameters, this.logger);
|
|
966
|
+
reqCnfData = generatedReqCnfData.reqCnfString;
|
|
967
|
+
validatedRequest.keyId = generatedReqCnfData.kid;
|
|
968
|
+
validatedRequest.signPopToken = true;
|
|
969
|
+
} else {
|
|
970
|
+
reqCnfData = this.browserCrypto.base64UrlEncode(
|
|
971
|
+
JSON.stringify({ kid: validatedRequest.keyId })
|
|
972
|
+
);
|
|
973
|
+
validatedRequest.signPopToken = false;
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
// SPAs require whole string to be passed to broker
|
|
977
|
+
validatedRequest.reqCnf = reqCnfData;
|
|
949
978
|
}
|
|
950
979
|
|
|
951
980
|
return validatedRequest;
|
package/src/packageMetadata.ts
CHANGED