@azure/msal-common 16.12.0 → 16.13.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/account/AccountInfo.mjs +1 -1
- package/dist/account/AuthToken.mjs +1 -1
- package/dist/account/CcsCredential.mjs +1 -1
- package/dist/account/ClientInfo.mjs +1 -1
- package/dist/account/TokenClaims.mjs +1 -1
- package/dist/authority/Authority.mjs +1 -1
- package/dist/authority/AuthorityFactory.mjs +1 -1
- package/dist/authority/AuthorityMetadata.mjs +2 -5
- package/dist/authority/AuthorityMetadata.mjs.map +1 -1
- package/dist/authority/AuthorityOptions.mjs +1 -1
- package/dist/authority/AuthorityType.mjs +1 -1
- package/dist/authority/CloudInstanceDiscoveryErrorResponse.mjs +1 -1
- package/dist/authority/CloudInstanceDiscoveryResponse.mjs +1 -1
- package/dist/authority/OpenIdConfigResponse.mjs +1 -1
- package/dist/authority/ProtocolMode.mjs +1 -1
- package/dist/authority/RegionDiscovery.mjs +1 -1
- package/dist/cache/CacheManager.mjs +28 -11
- package/dist/cache/CacheManager.mjs.map +1 -1
- package/dist/cache/persistence/TokenCacheContext.mjs +1 -1
- package/dist/cache/utils/AccountEntityUtils.mjs +1 -1
- package/dist/cache/utils/CacheHelpers.mjs +10 -3
- package/dist/cache/utils/CacheHelpers.mjs.map +1 -1
- package/dist/client/AuthorizationCodeClient.mjs +3 -3
- package/dist/client/AuthorizationCodeClient.mjs.map +1 -1
- package/dist/client/RefreshTokenClient.mjs +3 -3
- package/dist/client/RefreshTokenClient.mjs.map +1 -1
- package/dist/client/SilentFlowClient.mjs +5 -2
- package/dist/client/SilentFlowClient.mjs.map +1 -1
- package/dist/config/ClientConfiguration.mjs +4 -2
- package/dist/config/ClientConfiguration.mjs.map +1 -1
- package/dist/constants/AADServerParamKeys.mjs +1 -1
- package/dist/crypto/ICrypto.mjs +16 -11
- package/dist/crypto/ICrypto.mjs.map +1 -1
- package/dist/crypto/ITokenBindingKeyManager.mjs +28 -0
- package/dist/crypto/ITokenBindingKeyManager.mjs.map +1 -0
- package/dist/crypto/JoseHeader.mjs +38 -11
- package/dist/crypto/JoseHeader.mjs.map +1 -1
- package/dist/crypto/PopTokenGenerator.mjs +28 -5
- package/dist/crypto/PopTokenGenerator.mjs.map +1 -1
- package/dist/error/AuthError.mjs +1 -1
- package/dist/error/AuthErrorCodes.mjs +1 -1
- package/dist/error/CacheError.mjs +1 -1
- package/dist/error/CacheErrorCodes.mjs +1 -1
- package/dist/error/ClientAuthError.mjs +1 -1
- package/dist/error/ClientAuthErrorCodes.mjs +1 -1
- package/dist/error/ClientConfigurationError.mjs +1 -1
- package/dist/error/ClientConfigurationErrorCodes.mjs +3 -2
- package/dist/error/ClientConfigurationErrorCodes.mjs.map +1 -1
- package/dist/error/InteractionRequiredAuthError.mjs +1 -1
- package/dist/error/InteractionRequiredAuthErrorCodes.mjs +1 -1
- package/dist/error/JoseHeaderError.mjs +1 -1
- package/dist/error/JoseHeaderErrorCodes.mjs +5 -3
- package/dist/error/JoseHeaderErrorCodes.mjs.map +1 -1
- package/dist/error/NetworkError.mjs +1 -1
- package/dist/error/PlatformBrokerError.mjs +1 -1
- package/dist/error/ServerError.mjs +1 -1
- package/dist/index-node.mjs +3 -2
- package/dist/index-node.mjs.map +1 -1
- package/dist/index.mjs +3 -2
- package/dist/index.mjs.map +1 -1
- package/dist/logger/Logger.mjs +1 -1
- package/dist/network/INetworkModule.mjs +1 -1
- package/dist/network/RequestThumbprint.mjs +1 -1
- package/dist/network/ThrottlingUtils.mjs +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/protocol/Authorize.mjs +1 -1
- package/dist/protocol/Token.mjs +1 -1
- package/dist/request/AuthenticationHeaderParser.mjs +1 -1
- package/dist/request/BaseAuthRequest.mjs +1 -1
- package/dist/request/RequestParameterBuilder.mjs +1 -1
- package/dist/request/ScopeSet.mjs +1 -1
- package/dist/response/ResponseHandler.mjs +20 -6
- package/dist/response/ResponseHandler.mjs.map +1 -1
- package/dist/telemetry/performance/PerformanceClient.mjs +1 -1
- package/dist/telemetry/performance/PerformanceEvent.mjs +1 -1
- package/dist/telemetry/performance/PerformanceEvent.mjs.map +1 -1
- package/dist/telemetry/performance/PerformanceEvents.mjs +1 -1
- package/dist/telemetry/performance/StubPerformanceClient.mjs +1 -1
- package/dist/telemetry/server/ServerTelemetryManager.mjs +1 -1
- package/dist/url/UrlString.mjs +1 -1
- package/dist/utils/ClientAssertionUtils.mjs +1 -1
- package/dist/utils/Constants.mjs +2 -1
- package/dist/utils/Constants.mjs.map +1 -1
- package/dist/utils/FunctionWrappers.mjs +1 -1
- package/dist/utils/ObjectUtils.mjs +28 -0
- package/dist/utils/ObjectUtils.mjs.map +1 -0
- package/dist/utils/ProtocolUtils.mjs +1 -1
- package/dist/utils/StringUtils.mjs +1 -1
- package/dist/utils/TimeUtils.mjs +1 -1
- package/dist/utils/UrlUtils.mjs +1 -1
- package/dist-browser/account/AccountInfo.mjs +1 -1
- package/dist-browser/account/AuthToken.mjs +1 -1
- package/dist-browser/account/CcsCredential.mjs +1 -1
- package/dist-browser/account/ClientInfo.mjs +1 -1
- package/dist-browser/account/TokenClaims.mjs +1 -1
- package/dist-browser/authority/Authority.mjs +1 -1
- package/dist-browser/authority/AuthorityFactory.mjs +1 -1
- package/dist-browser/authority/AuthorityMetadata.mjs +2 -5
- package/dist-browser/authority/AuthorityMetadata.mjs.map +1 -1
- package/dist-browser/authority/AuthorityOptions.mjs +1 -1
- package/dist-browser/authority/AuthorityType.mjs +1 -1
- package/dist-browser/authority/CloudInstanceDiscoveryErrorResponse.mjs +1 -1
- package/dist-browser/authority/CloudInstanceDiscoveryResponse.mjs +1 -1
- package/dist-browser/authority/OpenIdConfigResponse.mjs +1 -1
- package/dist-browser/authority/ProtocolMode.mjs +1 -1
- package/dist-browser/authority/RegionDiscovery.mjs +1 -1
- package/dist-browser/cache/CacheManager.mjs +28 -11
- package/dist-browser/cache/CacheManager.mjs.map +1 -1
- package/dist-browser/cache/persistence/TokenCacheContext.mjs +1 -1
- package/dist-browser/cache/utils/AccountEntityUtils.mjs +1 -1
- package/dist-browser/cache/utils/CacheHelpers.mjs +10 -3
- package/dist-browser/cache/utils/CacheHelpers.mjs.map +1 -1
- package/dist-browser/client/AuthorizationCodeClient.mjs +3 -3
- package/dist-browser/client/AuthorizationCodeClient.mjs.map +1 -1
- package/dist-browser/client/RefreshTokenClient.mjs +3 -3
- package/dist-browser/client/RefreshTokenClient.mjs.map +1 -1
- package/dist-browser/client/SilentFlowClient.mjs +5 -2
- package/dist-browser/client/SilentFlowClient.mjs.map +1 -1
- package/dist-browser/config/ClientConfiguration.mjs +4 -2
- package/dist-browser/config/ClientConfiguration.mjs.map +1 -1
- package/dist-browser/constants/AADServerParamKeys.mjs +1 -1
- package/dist-browser/crypto/ICrypto.mjs +16 -11
- package/dist-browser/crypto/ICrypto.mjs.map +1 -1
- package/dist-browser/crypto/ITokenBindingKeyManager.mjs +28 -0
- package/dist-browser/crypto/ITokenBindingKeyManager.mjs.map +1 -0
- package/dist-browser/crypto/JoseHeader.mjs +38 -11
- package/dist-browser/crypto/JoseHeader.mjs.map +1 -1
- package/dist-browser/crypto/PopTokenGenerator.mjs +28 -5
- package/dist-browser/crypto/PopTokenGenerator.mjs.map +1 -1
- package/dist-browser/error/AuthError.mjs +1 -1
- package/dist-browser/error/AuthErrorCodes.mjs +1 -1
- package/dist-browser/error/CacheError.mjs +1 -1
- package/dist-browser/error/CacheErrorCodes.mjs +1 -1
- package/dist-browser/error/ClientAuthError.mjs +1 -1
- package/dist-browser/error/ClientAuthErrorCodes.mjs +1 -1
- package/dist-browser/error/ClientConfigurationError.mjs +1 -1
- package/dist-browser/error/ClientConfigurationErrorCodes.mjs +3 -2
- package/dist-browser/error/ClientConfigurationErrorCodes.mjs.map +1 -1
- package/dist-browser/error/InteractionRequiredAuthError.mjs +1 -1
- package/dist-browser/error/InteractionRequiredAuthErrorCodes.mjs +1 -1
- package/dist-browser/error/JoseHeaderError.mjs +1 -1
- package/dist-browser/error/JoseHeaderErrorCodes.mjs +5 -3
- package/dist-browser/error/JoseHeaderErrorCodes.mjs.map +1 -1
- package/dist-browser/error/NetworkError.mjs +1 -1
- package/dist-browser/error/PlatformBrokerError.mjs +1 -1
- package/dist-browser/error/ServerError.mjs +1 -1
- package/dist-browser/index-browser.mjs +3 -2
- package/dist-browser/index-browser.mjs.map +1 -1
- package/dist-browser/index.mjs +3 -2
- package/dist-browser/index.mjs.map +1 -1
- package/dist-browser/log-strings-mapping.json +2 -2
- package/dist-browser/logger/Logger.mjs +1 -1
- package/dist-browser/network/INetworkModule.mjs +1 -1
- package/dist-browser/network/RequestThumbprint.mjs +1 -1
- package/dist-browser/network/ThrottlingUtils.mjs +1 -1
- package/dist-browser/packageMetadata.mjs +2 -2
- package/dist-browser/protocol/Authorize.mjs +1 -1
- package/dist-browser/protocol/Token.mjs +1 -1
- package/dist-browser/request/AuthenticationHeaderParser.mjs +1 -1
- package/dist-browser/request/BaseAuthRequest.mjs +1 -1
- package/dist-browser/request/RequestParameterBuilder.mjs +1 -1
- package/dist-browser/request/ScopeSet.mjs +1 -1
- package/dist-browser/response/ResponseHandler.mjs +20 -6
- package/dist-browser/response/ResponseHandler.mjs.map +1 -1
- package/dist-browser/telemetry/performance/PerformanceClient.mjs +1 -1
- package/dist-browser/telemetry/performance/PerformanceEvent.mjs +1 -1
- package/dist-browser/telemetry/performance/PerformanceEvent.mjs.map +1 -1
- package/dist-browser/telemetry/performance/PerformanceEvents.mjs +1 -1
- package/dist-browser/telemetry/performance/StubPerformanceClient.mjs +1 -1
- package/dist-browser/telemetry/server/ServerTelemetryManager.mjs +1 -1
- package/dist-browser/url/UrlString.mjs +1 -1
- package/dist-browser/utils/ClientAssertionUtils.mjs +1 -1
- package/dist-browser/utils/Constants.mjs +2 -1
- package/dist-browser/utils/Constants.mjs.map +1 -1
- package/dist-browser/utils/FunctionWrappers.mjs +1 -1
- package/dist-browser/utils/ObjectUtils.mjs +28 -0
- package/dist-browser/utils/ObjectUtils.mjs.map +1 -0
- package/dist-browser/utils/ProtocolUtils.mjs +1 -1
- package/dist-browser/utils/StringUtils.mjs +1 -1
- package/dist-browser/utils/TimeUtils.mjs +1 -1
- package/dist-browser/utils/UrlUtils.mjs +1 -1
- package/lib/index-browser.cjs +5 -67
- package/lib/index-browser.cjs.map +1 -1
- package/lib/{index-node-3p7V__ym.js → index-node-BaODPZEy.js} +252 -46
- package/lib/index-node-BaODPZEy.js.map +1 -0
- package/lib/index-node.cjs +4 -2
- package/lib/index-node.cjs.map +1 -1
- package/lib/index.cjs +5 -3
- package/lib/index.cjs.map +1 -1
- package/package.json +1 -1
- package/src/authority/AuthorityMetadata.ts +1 -4
- package/src/cache/CacheManager.ts +46 -13
- package/src/cache/utils/CacheHelpers.ts +11 -1
- package/src/client/AuthorizationCodeClient.ts +3 -1
- package/src/client/RefreshTokenClient.ts +3 -1
- package/src/client/SilentFlowClient.ts +4 -1
- package/src/config/ClientConfiguration.ts +10 -0
- package/src/crypto/DpopProofGenerator.ts +52 -59
- package/src/crypto/ICrypto.ts +31 -26
- package/src/crypto/ITokenBindingKeyManager.ts +84 -0
- package/src/crypto/JoseHeader.ts +74 -14
- package/src/crypto/PopTokenGenerator.ts +62 -18
- package/src/error/ClientConfigurationErrorCodes.ts +2 -0
- package/src/error/JoseHeaderErrorCodes.ts +2 -0
- package/src/exports-common.ts +7 -0
- package/src/packageMetadata.ts +1 -1
- package/src/response/ResponseHandler.ts +43 -14
- package/src/telemetry/performance/PerformanceEvent.ts +10 -0
- package/src/utils/Constants.ts +1 -0
- package/src/utils/ObjectUtils.ts +31 -0
- package/types/authority/AuthorityMetadata.d.ts.map +1 -1
- package/types/cache/CacheManager.d.ts +2 -0
- package/types/cache/CacheManager.d.ts.map +1 -1
- package/types/cache/utils/CacheHelpers.d.ts.map +1 -1
- package/types/client/AuthorizationCodeClient.d.ts.map +1 -1
- package/types/client/RefreshTokenClient.d.ts.map +1 -1
- package/types/client/SilentFlowClient.d.ts.map +1 -1
- package/types/config/ClientConfiguration.d.ts +5 -1
- package/types/config/ClientConfiguration.d.ts.map +1 -1
- package/types/crypto/DpopProofGenerator.d.ts +10 -36
- package/types/crypto/DpopProofGenerator.d.ts.map +1 -1
- package/types/crypto/ICrypto.d.ts +10 -9
- package/types/crypto/ICrypto.d.ts.map +1 -1
- package/types/crypto/ITokenBindingKeyManager.d.ts +41 -0
- package/types/crypto/ITokenBindingKeyManager.d.ts.map +1 -0
- package/types/crypto/JoseHeader.d.ts +17 -5
- package/types/crypto/JoseHeader.d.ts.map +1 -1
- package/types/crypto/PopTokenGenerator.d.ts +3 -1
- package/types/crypto/PopTokenGenerator.d.ts.map +1 -1
- package/types/error/ClientConfigurationErrorCodes.d.ts +1 -0
- package/types/error/ClientConfigurationErrorCodes.d.ts.map +1 -1
- package/types/error/JoseHeaderErrorCodes.d.ts +2 -0
- package/types/error/JoseHeaderErrorCodes.d.ts.map +1 -1
- package/types/exports-common.d.ts +3 -2
- package/types/exports-common.d.ts.map +1 -1
- package/types/packageMetadata.d.ts +1 -1
- package/types/response/ResponseHandler.d.ts +12 -2
- package/types/response/ResponseHandler.d.ts.map +1 -1
- package/types/telemetry/performance/PerformanceEvent.d.ts +8 -0
- package/types/telemetry/performance/PerformanceEvent.d.ts.map +1 -1
- package/types/utils/Constants.d.ts +1 -0
- package/types/utils/Constants.d.ts.map +1 -1
- package/types/utils/ObjectUtils.d.ts +6 -0
- package/types/utils/ObjectUtils.d.ts.map +1 -0
- package/lib/index-node-3p7V__ym.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-common v16.
|
|
1
|
+
/*! @azure/msal-common v16.13.0 2026-08-18 */
|
|
2
2
|
'use strict';
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
@@ -266,6 +266,7 @@ const invalidAuthorityMetadata = "invalid_authority_metadata";
|
|
|
266
266
|
const untrustedAuthority = "untrusted_authority";
|
|
267
267
|
const missingSshJwk = "missing_ssh_jwk";
|
|
268
268
|
const missingSshKid = "missing_ssh_kid";
|
|
269
|
+
const unsupportedAuthenticationScheme = "unsupported_authentication_scheme";
|
|
269
270
|
const missingNonceAuthenticationHeader = "missing_nonce_authentication_header";
|
|
270
271
|
const invalidAuthenticationHeader = "invalid_authentication_header";
|
|
271
272
|
const cannotSetOIDCOptions = "cannot_set_OIDCOptions";
|
|
@@ -304,6 +305,7 @@ var ClientConfigurationErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
304
305
|
pkceParamsMissing: pkceParamsMissing,
|
|
305
306
|
redirectUriEmpty: redirectUriEmpty,
|
|
306
307
|
tokenRequestEmpty: tokenRequestEmpty,
|
|
308
|
+
unsupportedAuthenticationScheme: unsupportedAuthenticationScheme,
|
|
307
309
|
untrustedAuthority: untrustedAuthority,
|
|
308
310
|
urlEmptyError: urlEmptyError,
|
|
309
311
|
urlParseError: urlParseError
|
|
@@ -694,6 +696,7 @@ const JsonWebTokenTypes = {
|
|
|
694
696
|
Jwt: "JWT",
|
|
695
697
|
Jwk: "JWK",
|
|
696
698
|
Pop: "pop",
|
|
699
|
+
Dpop: "dpop+jwt",
|
|
697
700
|
};
|
|
698
701
|
const ONE_DAY_IN_MS = 86400000;
|
|
699
702
|
// Token renewal offset default in seconds
|
|
@@ -971,10 +974,7 @@ class UrlString {
|
|
|
971
974
|
// Build endpoint metadata dynamically to avoid string duplication
|
|
972
975
|
const endpointHosts = [
|
|
973
976
|
{ host: "login.microsoftonline.com" },
|
|
974
|
-
{
|
|
975
|
-
host: "login.chinacloudapi.cn",
|
|
976
|
-
issuerHost: "login.partner.microsoftonline.cn", // Issuer differs
|
|
977
|
-
},
|
|
977
|
+
{ host: "login.partner.microsoftonline.cn" },
|
|
978
978
|
{ host: "login.microsoftonline.us" },
|
|
979
979
|
{ host: "login.sovcloud-identity.fr" },
|
|
980
980
|
{ host: "login.sovcloud-identity.de" },
|
|
@@ -1627,6 +1627,7 @@ function createAccessTokenEntity(homeAccountId, environment, accessToken, client
|
|
|
1627
1627
|
if (refreshOn) {
|
|
1628
1628
|
atEntity.refreshOn = refreshOn.toString();
|
|
1629
1629
|
}
|
|
1630
|
+
const normalizedTokenType = atEntity.tokenType?.toLowerCase();
|
|
1630
1631
|
/*
|
|
1631
1632
|
* Create Access Token With Auth Scheme instead of regular access token
|
|
1632
1633
|
* Cast to lower to handle "bearer" from ADFS
|
|
@@ -1635,7 +1636,7 @@ function createAccessTokenEntity(homeAccountId, environment, accessToken, client
|
|
|
1635
1636
|
AuthenticationScheme.BEARER.toLowerCase()) {
|
|
1636
1637
|
atEntity.credentialType =
|
|
1637
1638
|
CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME;
|
|
1638
|
-
switch (
|
|
1639
|
+
switch (normalizedTokenType) {
|
|
1639
1640
|
case AuthenticationScheme.POP:
|
|
1640
1641
|
// Make sure keyId is present and add it to credential
|
|
1641
1642
|
const tokenClaims = extractTokenClaims(accessToken, base64Decode, correlationId);
|
|
@@ -1644,6 +1645,12 @@ function createAccessTokenEntity(homeAccountId, environment, accessToken, client
|
|
|
1644
1645
|
}
|
|
1645
1646
|
atEntity.keyId = tokenClaims.cnf.kid;
|
|
1646
1647
|
break;
|
|
1648
|
+
case "dpop":
|
|
1649
|
+
if (!keyId) {
|
|
1650
|
+
throw createClientAuthError(keyIdMissing, correlationId);
|
|
1651
|
+
}
|
|
1652
|
+
atEntity.keyId = keyId;
|
|
1653
|
+
break;
|
|
1647
1654
|
case AuthenticationScheme.SSH:
|
|
1648
1655
|
atEntity.keyId = keyId;
|
|
1649
1656
|
}
|
|
@@ -4038,7 +4045,7 @@ function parseClaims(claims, correlationId = "") {
|
|
|
4038
4045
|
// Malformed JSON
|
|
4039
4046
|
throw createClientConfigurationError(invalidClaims, correlationId);
|
|
4040
4047
|
}
|
|
4041
|
-
if (!isPlainObject(parsed)) {
|
|
4048
|
+
if (!isPlainObject$1(parsed)) {
|
|
4042
4049
|
// Valid JSON, but not an object (e.g. an array, a scalar, or the literal `null`).
|
|
4043
4050
|
throw createClientConfigurationError(invalidClaims, correlationId);
|
|
4044
4051
|
}
|
|
@@ -4049,7 +4056,7 @@ function parseClaims(claims, correlationId = "") {
|
|
|
4049
4056
|
* @param value - The value to test
|
|
4050
4057
|
* @returns True when value is a plain object that can be deep-merged
|
|
4051
4058
|
*/
|
|
4052
|
-
function isPlainObject(value) {
|
|
4059
|
+
function isPlainObject$1(value) {
|
|
4053
4060
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
4054
4061
|
}
|
|
4055
4062
|
/**
|
|
@@ -4066,7 +4073,7 @@ function deepMergeClaims(baseClaims, claimsToMerge) {
|
|
|
4066
4073
|
const merged = { ...baseClaims };
|
|
4067
4074
|
for (const [key, mergeInValue] of Object.entries(claimsToMerge)) {
|
|
4068
4075
|
const baseValue = merged[key];
|
|
4069
|
-
if (isPlainObject(baseValue) && isPlainObject(mergeInValue)) {
|
|
4076
|
+
if (isPlainObject$1(baseValue) && isPlainObject$1(mergeInValue)) {
|
|
4070
4077
|
merged[key] = deepMergeClaims(baseValue, mergeInValue);
|
|
4071
4078
|
}
|
|
4072
4079
|
else {
|
|
@@ -4273,6 +4280,14 @@ var RequestParameterBuilder = /*#__PURE__*/Object.freeze({
|
|
|
4273
4280
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4274
4281
|
* Licensed under the MIT License.
|
|
4275
4282
|
*/
|
|
4283
|
+
/**
|
|
4284
|
+
* Shared JOSE algorithm literals used by MSAL package internals.
|
|
4285
|
+
* @internal
|
|
4286
|
+
*/
|
|
4287
|
+
const JsonWebTokenAlgorithms = {
|
|
4288
|
+
ES256: "ES256",
|
|
4289
|
+
RS256: "RS256",
|
|
4290
|
+
};
|
|
4276
4291
|
/**
|
|
4277
4292
|
* Default crypto implementation used when a platform-specific implementation has
|
|
4278
4293
|
* not been provided.
|
|
@@ -4293,23 +4308,41 @@ const DEFAULT_CRYPTO_IMPLEMENTATION = {
|
|
|
4293
4308
|
encodeKid: () => {
|
|
4294
4309
|
throw createClientAuthError(methodNotImplemented, "");
|
|
4295
4310
|
},
|
|
4296
|
-
async
|
|
4297
|
-
throw createClientAuthError(methodNotImplemented,
|
|
4311
|
+
async removeTokenBindingKey(kid, correlationId) {
|
|
4312
|
+
throw createClientAuthError(methodNotImplemented, correlationId);
|
|
4298
4313
|
},
|
|
4299
|
-
async
|
|
4300
|
-
throw createClientAuthError(methodNotImplemented,
|
|
4314
|
+
async clearKeystore(correlationId) {
|
|
4315
|
+
throw createClientAuthError(methodNotImplemented, correlationId);
|
|
4301
4316
|
},
|
|
4302
|
-
async
|
|
4303
|
-
throw createClientAuthError(methodNotImplemented,
|
|
4304
|
-
},
|
|
4305
|
-
async signJwt() {
|
|
4306
|
-
throw createClientAuthError(methodNotImplemented, "");
|
|
4317
|
+
async signTokenBindingJwt(header, payload, kid, correlationId) {
|
|
4318
|
+
throw createClientAuthError(methodNotImplemented, correlationId);
|
|
4307
4319
|
},
|
|
4308
4320
|
async hashString() {
|
|
4309
4321
|
throw createClientAuthError(methodNotImplemented, "");
|
|
4310
4322
|
},
|
|
4311
4323
|
};
|
|
4312
4324
|
|
|
4325
|
+
/*
|
|
4326
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4327
|
+
* Licensed under the MIT License.
|
|
4328
|
+
*/
|
|
4329
|
+
/**
|
|
4330
|
+
* Default token-binding key manager used when a platform-specific implementation
|
|
4331
|
+
* has not been provided.
|
|
4332
|
+
* @internal
|
|
4333
|
+
*/
|
|
4334
|
+
const DEFAULT_TOKEN_BINDING_KEY_MANAGER = {
|
|
4335
|
+
async provisionTokenBindingKey(request) {
|
|
4336
|
+
throw createClientAuthError(methodNotImplemented, request.correlationId);
|
|
4337
|
+
},
|
|
4338
|
+
async removeTokenBindingKey(_kid, correlationId) {
|
|
4339
|
+
throw createClientAuthError(methodNotImplemented, correlationId);
|
|
4340
|
+
},
|
|
4341
|
+
async getTokenBindingPublicKeyJwk(_kid, correlationId) {
|
|
4342
|
+
throw createClientAuthError(methodNotImplemented, correlationId);
|
|
4343
|
+
},
|
|
4344
|
+
};
|
|
4345
|
+
|
|
4313
4346
|
/*
|
|
4314
4347
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4315
4348
|
* Licensed under the MIT License.
|
|
@@ -4600,7 +4633,7 @@ class Logger {
|
|
|
4600
4633
|
|
|
4601
4634
|
/* eslint-disable header/header */
|
|
4602
4635
|
const name = "@azure/msal-common";
|
|
4603
|
-
const version = "16.
|
|
4636
|
+
const version = "16.13.0";
|
|
4604
4637
|
|
|
4605
4638
|
/*
|
|
4606
4639
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5010,16 +5043,9 @@ class CacheManager {
|
|
|
5010
5043
|
// Access Token with Auth Scheme specific matching
|
|
5011
5044
|
if (entity.credentialType ===
|
|
5012
5045
|
CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME) {
|
|
5013
|
-
if (
|
|
5014
|
-
!this.matchTokenType(entity, filter.tokenType)) {
|
|
5046
|
+
if (!this.matchAccessTokenWithAuthScheme(entity, filter)) {
|
|
5015
5047
|
return false;
|
|
5016
5048
|
}
|
|
5017
|
-
// KeyId (sshKid) in request must match cached SSH certificate keyId because SSH cert is bound to a specific key
|
|
5018
|
-
if (filter.tokenType === AuthenticationScheme.SSH) {
|
|
5019
|
-
if (filter.keyId && !this.matchKeyId(entity, filter.keyId)) {
|
|
5020
|
-
return false;
|
|
5021
|
-
}
|
|
5022
|
-
}
|
|
5023
5049
|
}
|
|
5024
5050
|
// Additional cache key components matching (bidirectional isolation)
|
|
5025
5051
|
const entityComponents = entity.additionalCacheKeyComponents;
|
|
@@ -5336,7 +5362,9 @@ class CacheManager {
|
|
|
5336
5362
|
realm: targetRealm || account.tenantId,
|
|
5337
5363
|
target: scopes,
|
|
5338
5364
|
tokenType: authScheme,
|
|
5339
|
-
keyId:
|
|
5365
|
+
keyId: authScheme === AuthenticationScheme.SSH
|
|
5366
|
+
? request.sshKid
|
|
5367
|
+
: undefined,
|
|
5340
5368
|
additionalCacheKeyComponents: additionalCacheKeyComponents,
|
|
5341
5369
|
};
|
|
5342
5370
|
const accessTokenKeys = (tokenKeys && tokenKeys.accessToken) ||
|
|
@@ -5698,7 +5726,29 @@ class CacheManager {
|
|
|
5698
5726
|
* @param tokenType
|
|
5699
5727
|
*/
|
|
5700
5728
|
matchTokenType(entity, tokenType) {
|
|
5701
|
-
return !!(entity.tokenType &&
|
|
5729
|
+
return !!(entity.tokenType &&
|
|
5730
|
+
entity.tokenType.toLowerCase() === tokenType.toLowerCase());
|
|
5731
|
+
}
|
|
5732
|
+
matchAccessTokenWithAuthScheme(entity, filter) {
|
|
5733
|
+
const normalizedFilterTokenType = filter.tokenType?.toLowerCase();
|
|
5734
|
+
if (!!filter.tokenType &&
|
|
5735
|
+
!this.matchTokenType(entity, filter.tokenType)) {
|
|
5736
|
+
return false;
|
|
5737
|
+
}
|
|
5738
|
+
switch (normalizedFilterTokenType) {
|
|
5739
|
+
case "dpop":
|
|
5740
|
+
return this.matchKeyBoundAccessToken(entity, filter, true);
|
|
5741
|
+
case AuthenticationScheme.SSH:
|
|
5742
|
+
return this.matchKeyBoundAccessToken(entity, filter, false);
|
|
5743
|
+
default:
|
|
5744
|
+
return true;
|
|
5745
|
+
}
|
|
5746
|
+
}
|
|
5747
|
+
matchKeyBoundAccessToken(entity, filter, requireKeyId) {
|
|
5748
|
+
if (!filter.keyId) {
|
|
5749
|
+
return !requireKeyId;
|
|
5750
|
+
}
|
|
5751
|
+
return this.matchKeyId(entity, filter.keyId);
|
|
5702
5752
|
}
|
|
5703
5753
|
/**
|
|
5704
5754
|
* Returns true if the credential's keyId matches the one in the request, false otherwise
|
|
@@ -5988,7 +6038,7 @@ const DEFAULT_TELEMETRY_OPTIONS = {
|
|
|
5988
6038
|
* @returns Configuration
|
|
5989
6039
|
* @internal
|
|
5990
6040
|
*/
|
|
5991
|
-
function buildClientConfiguration({ authOptions: userAuthOptions, systemOptions: userSystemOptions, loggerOptions: userLoggerOption, storageInterface: storageImplementation, networkInterface: networkImplementation, cryptoInterface: cryptoImplementation, clientCredentials: clientCredentials, libraryInfo: libraryInfo, telemetry: telemetry, serverTelemetryManager: serverTelemetryManager, persistencePlugin: persistencePlugin, serializableCache: serializableCache, }) {
|
|
6041
|
+
function buildClientConfiguration({ authOptions: userAuthOptions, systemOptions: userSystemOptions, loggerOptions: userLoggerOption, storageInterface: storageImplementation, networkInterface: networkImplementation, cryptoInterface: cryptoImplementation, tokenBindingKeyManager: tokenBindingKeyManager, clientCredentials: clientCredentials, libraryInfo: libraryInfo, telemetry: telemetry, serverTelemetryManager: serverTelemetryManager, persistencePlugin: persistencePlugin, serializableCache: serializableCache, }) {
|
|
5992
6042
|
const loggerOptions = {
|
|
5993
6043
|
...DEFAULT_LOGGER_IMPLEMENTATION,
|
|
5994
6044
|
...userLoggerOption,
|
|
@@ -6001,6 +6051,7 @@ function buildClientConfiguration({ authOptions: userAuthOptions, systemOptions:
|
|
|
6001
6051
|
new DefaultStorageClass(userAuthOptions.clientId, DEFAULT_CRYPTO_IMPLEMENTATION, new Logger(loggerOptions, name, version), new StubPerformanceClient()),
|
|
6002
6052
|
networkInterface: networkImplementation || DEFAULT_NETWORK_IMPLEMENTATION,
|
|
6003
6053
|
cryptoInterface: cryptoImplementation || DEFAULT_CRYPTO_IMPLEMENTATION,
|
|
6054
|
+
tokenBindingKeyManager: tokenBindingKeyManager || DEFAULT_TOKEN_BINDING_KEY_MANAGER,
|
|
6004
6055
|
clientCredentials: clientCredentials || DEFAULT_CLIENT_CREDENTIALS,
|
|
6005
6056
|
libraryInfo: { ...DEFAULT_LIBRARY_INFO, ...libraryInfo },
|
|
6006
6057
|
telemetry: { ...DEFAULT_TELEMETRY_OPTIONS, ...telemetry },
|
|
@@ -6056,16 +6107,135 @@ function isOidcProtocolMode(config) {
|
|
|
6056
6107
|
}
|
|
6057
6108
|
}
|
|
6058
6109
|
|
|
6110
|
+
/*
|
|
6111
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6112
|
+
* Licensed under the MIT License.
|
|
6113
|
+
*/
|
|
6114
|
+
const missingKidError = "missing_kid_error";
|
|
6115
|
+
const missingAlgError = "missing_alg_error";
|
|
6116
|
+
const missingJwkError = "missing_jwk_error";
|
|
6117
|
+
const invalidJwkError = "invalid_jwk_error";
|
|
6118
|
+
|
|
6119
|
+
/*
|
|
6120
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6121
|
+
* Licensed under the MIT License.
|
|
6122
|
+
*/
|
|
6123
|
+
/**
|
|
6124
|
+
* Error thrown when there is an error in the client code running on the browser.
|
|
6125
|
+
*/
|
|
6126
|
+
class JoseHeaderError extends AuthError {
|
|
6127
|
+
constructor(errorCode, correlationId, errorMessage) {
|
|
6128
|
+
super(errorCode, correlationId, errorMessage);
|
|
6129
|
+
this.name = "JoseHeaderError";
|
|
6130
|
+
Object.setPrototypeOf(this, JoseHeaderError.prototype);
|
|
6131
|
+
}
|
|
6132
|
+
}
|
|
6133
|
+
/** Returns JoseHeaderError object */
|
|
6134
|
+
function createJoseHeaderError(code, correlationId) {
|
|
6135
|
+
return new JoseHeaderError(code, correlationId);
|
|
6136
|
+
}
|
|
6137
|
+
|
|
6138
|
+
/*
|
|
6139
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6140
|
+
* Licensed under the MIT License.
|
|
6141
|
+
*/
|
|
6142
|
+
/**
|
|
6143
|
+
* Checks whether a value is a plain JSON-like object.
|
|
6144
|
+
* Allows objects with null prototypes, but rejects arrays and object subclasses.
|
|
6145
|
+
*/
|
|
6146
|
+
function isPlainObject(value) {
|
|
6147
|
+
if (typeof value !== "object" ||
|
|
6148
|
+
value === null ||
|
|
6149
|
+
Object.prototype.toString.call(value) !== "[object Object]") {
|
|
6150
|
+
return false;
|
|
6151
|
+
}
|
|
6152
|
+
if (Object.getPrototypeOf(value) === null) {
|
|
6153
|
+
return true;
|
|
6154
|
+
}
|
|
6155
|
+
let proto = value;
|
|
6156
|
+
while (Object.getPrototypeOf(proto) !== null) {
|
|
6157
|
+
proto = Object.getPrototypeOf(proto);
|
|
6158
|
+
}
|
|
6159
|
+
return Object.getPrototypeOf(value) === proto;
|
|
6160
|
+
}
|
|
6161
|
+
|
|
6162
|
+
/*
|
|
6163
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6164
|
+
* Licensed under the MIT License.
|
|
6165
|
+
*/
|
|
6166
|
+
/** @internal */
|
|
6167
|
+
class JoseHeader {
|
|
6168
|
+
constructor(options, correlationId) {
|
|
6169
|
+
if (typeof options.alg !== "string" || !options.alg) {
|
|
6170
|
+
throw createJoseHeaderError(missingAlgError, correlationId);
|
|
6171
|
+
}
|
|
6172
|
+
this.typ = options.typ;
|
|
6173
|
+
this.alg = options.alg;
|
|
6174
|
+
this.kid = options.kid;
|
|
6175
|
+
this.jwk = options.jwk;
|
|
6176
|
+
}
|
|
6177
|
+
/**
|
|
6178
|
+
* Builds SignedHttpRequest formatted JOSE Header from the
|
|
6179
|
+
* JOSE Header options provided or previously set on the object.
|
|
6180
|
+
* Throws if keyId or algorithm aren't provided since they are required for Access Token Binding.
|
|
6181
|
+
* @param shrHeaderOptions
|
|
6182
|
+
* @param correlationId
|
|
6183
|
+
* @returns
|
|
6184
|
+
*/
|
|
6185
|
+
static getShrHeader(shrHeaderOptions, correlationId) {
|
|
6186
|
+
// KeyID is required on the SHR header
|
|
6187
|
+
if (!shrHeaderOptions.kid) {
|
|
6188
|
+
throw createJoseHeaderError(missingKidError, correlationId);
|
|
6189
|
+
}
|
|
6190
|
+
// Alg is required on the SHR header
|
|
6191
|
+
if (!shrHeaderOptions.alg) {
|
|
6192
|
+
throw createJoseHeaderError(missingAlgError, correlationId);
|
|
6193
|
+
}
|
|
6194
|
+
return new JoseHeader({
|
|
6195
|
+
// Access Token PoP headers must have type pop, but the type header can be overriden for special cases
|
|
6196
|
+
typ: shrHeaderOptions.typ || JsonWebTokenTypes.Pop,
|
|
6197
|
+
kid: shrHeaderOptions.kid,
|
|
6198
|
+
alg: shrHeaderOptions.alg,
|
|
6199
|
+
}, correlationId);
|
|
6200
|
+
}
|
|
6201
|
+
/**
|
|
6202
|
+
* Builds a DPoP formatted JOSE Header from the JOSE Header options provided.
|
|
6203
|
+
* Throws if public JWK or algorithm aren't provided since they are required for DPoP.
|
|
6204
|
+
* @param dpopHeaderOptions
|
|
6205
|
+
* @param correlationId
|
|
6206
|
+
* @returns
|
|
6207
|
+
*/
|
|
6208
|
+
static getDpopHeader(dpopHeaderOptions, correlationId) {
|
|
6209
|
+
if (!isPlainObject(dpopHeaderOptions.jwk)) {
|
|
6210
|
+
throw createJoseHeaderError(missingJwkError, correlationId);
|
|
6211
|
+
}
|
|
6212
|
+
if (!dpopHeaderOptions.alg) {
|
|
6213
|
+
throw createJoseHeaderError(missingAlgError, correlationId);
|
|
6214
|
+
}
|
|
6215
|
+
if (Object.keys(dpopHeaderOptions.jwk).length === 0) {
|
|
6216
|
+
throw createJoseHeaderError(invalidJwkError, correlationId);
|
|
6217
|
+
}
|
|
6218
|
+
return new JoseHeader({
|
|
6219
|
+
typ: JsonWebTokenTypes.Dpop,
|
|
6220
|
+
alg: dpopHeaderOptions.alg,
|
|
6221
|
+
jwk: dpopHeaderOptions.jwk,
|
|
6222
|
+
}, correlationId);
|
|
6223
|
+
}
|
|
6224
|
+
}
|
|
6225
|
+
|
|
6059
6226
|
/*
|
|
6060
6227
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6061
6228
|
* Licensed under the MIT License.
|
|
6062
6229
|
*/
|
|
6063
6230
|
const KeyLocation = {
|
|
6064
6231
|
SW: "sw"};
|
|
6232
|
+
const SHR_TOKEN_BINDING_KEY_TYPE = "shr";
|
|
6233
|
+
const SHR_TOKEN_BINDING_KEY_ALGORITHM = JsonWebTokenAlgorithms.RS256;
|
|
6065
6234
|
/** @internal */
|
|
6066
6235
|
class PopTokenGenerator {
|
|
6067
|
-
constructor(cryptoUtils, performanceClient) {
|
|
6236
|
+
constructor(cryptoUtils, tokenBindingKeyManager, performanceClient) {
|
|
6068
6237
|
this.cryptoUtils = cryptoUtils;
|
|
6238
|
+
this.tokenBindingKeyManager = tokenBindingKeyManager;
|
|
6069
6239
|
this.performanceClient = performanceClient;
|
|
6070
6240
|
}
|
|
6071
6241
|
/**
|
|
@@ -6088,7 +6258,11 @@ class PopTokenGenerator {
|
|
|
6088
6258
|
* @returns
|
|
6089
6259
|
*/
|
|
6090
6260
|
async generateKid(request) {
|
|
6091
|
-
const kidThumbprint = await this.
|
|
6261
|
+
const kidThumbprint = await this.tokenBindingKeyManager.provisionTokenBindingKey({
|
|
6262
|
+
correlationId: request.correlationId,
|
|
6263
|
+
tokenBindingKeyType: SHR_TOKEN_BINDING_KEY_TYPE,
|
|
6264
|
+
tokenBindingKeyAlgorithm: SHR_TOKEN_BINDING_KEY_ALGORITHM,
|
|
6265
|
+
});
|
|
6092
6266
|
return {
|
|
6093
6267
|
kid: kidThumbprint,
|
|
6094
6268
|
xms_ksl: KeyLocation.SW,
|
|
@@ -6118,7 +6292,17 @@ class PopTokenGenerator {
|
|
|
6118
6292
|
? new UrlString(resourceRequestUri, request.correlationId)
|
|
6119
6293
|
: undefined;
|
|
6120
6294
|
const resourceUrlComponents = resourceUrlString?.getUrlComponents();
|
|
6121
|
-
|
|
6295
|
+
const publicKeyJwk = await this.tokenBindingKeyManager.getTokenBindingPublicKeyJwk(keyId, request.correlationId);
|
|
6296
|
+
const encodedKeyIdThumbprint = this.cryptoUtils.base64UrlEncode(JSON.stringify({ kid: keyId }));
|
|
6297
|
+
const shrAlgorithm = shrOptions?.header?.alg ||
|
|
6298
|
+
publicKeyJwk.alg ||
|
|
6299
|
+
SHR_TOKEN_BINDING_KEY_ALGORITHM;
|
|
6300
|
+
const shrHeader = JoseHeader.getShrHeader({
|
|
6301
|
+
...shrOptions?.header,
|
|
6302
|
+
alg: shrAlgorithm,
|
|
6303
|
+
kid: encodedKeyIdThumbprint,
|
|
6304
|
+
}, request.correlationId);
|
|
6305
|
+
const shrPayload = {
|
|
6122
6306
|
at: payload,
|
|
6123
6307
|
ts: nowSeconds(),
|
|
6124
6308
|
m: resourceRequestMethod?.toUpperCase(),
|
|
@@ -6130,7 +6314,11 @@ class PopTokenGenerator {
|
|
|
6130
6314
|
: undefined,
|
|
6131
6315
|
client_claims: shrClaims || undefined,
|
|
6132
6316
|
...claims,
|
|
6133
|
-
|
|
6317
|
+
cnf: {
|
|
6318
|
+
jwk: publicKeyJwk,
|
|
6319
|
+
},
|
|
6320
|
+
};
|
|
6321
|
+
return this.cryptoUtils.signTokenBindingJwt(shrHeader, shrPayload, keyId, request.correlationId);
|
|
6134
6322
|
}
|
|
6135
6323
|
}
|
|
6136
6324
|
|
|
@@ -6364,10 +6552,11 @@ var ProtocolUtils = /*#__PURE__*/Object.freeze({
|
|
|
6364
6552
|
* @internal
|
|
6365
6553
|
*/
|
|
6366
6554
|
class ResponseHandler {
|
|
6367
|
-
constructor(clientId, cacheStorage, cryptoObj, logger, performanceClient, serializableCache, persistencePlugin) {
|
|
6555
|
+
constructor(clientId, cacheStorage, cryptoObj, logger, performanceClient, serializableCache, persistencePlugin, tokenBindingKeyManager = DEFAULT_TOKEN_BINDING_KEY_MANAGER) {
|
|
6368
6556
|
this.clientId = clientId;
|
|
6369
6557
|
this.cacheStorage = cacheStorage;
|
|
6370
6558
|
this.cryptoObj = cryptoObj;
|
|
6559
|
+
this.tokenBindingKeyManager = tokenBindingKeyManager;
|
|
6371
6560
|
this.logger = logger;
|
|
6372
6561
|
this.performanceClient = performanceClient;
|
|
6373
6562
|
this.serializableCache = serializableCache;
|
|
@@ -6476,7 +6665,12 @@ class ResponseHandler {
|
|
|
6476
6665
|
this.performanceClient?.addFields({
|
|
6477
6666
|
acntLoggedOut: true,
|
|
6478
6667
|
}, request.correlationId);
|
|
6479
|
-
return await ResponseHandler.generateAuthenticationResult(this.cryptoObj, authority, cacheRecord, false, request, this.performanceClient,
|
|
6668
|
+
return await ResponseHandler.generateAuthenticationResult(this.cryptoObj, authority, cacheRecord, false, request, this.performanceClient, {
|
|
6669
|
+
idTokenClaims,
|
|
6670
|
+
requestState: requestStateObj,
|
|
6671
|
+
requestId: serverRequestId,
|
|
6672
|
+
tokenBindingKeyManager: this.tokenBindingKeyManager,
|
|
6673
|
+
});
|
|
6480
6674
|
}
|
|
6481
6675
|
}
|
|
6482
6676
|
await this.cacheStorage.saveCacheRecord(cacheRecord, request.correlationId, isKmsi(idTokenClaims || {}), apiId, request.storeInCache);
|
|
@@ -6489,7 +6683,13 @@ class ResponseHandler {
|
|
|
6489
6683
|
await this.persistencePlugin.afterCacheAccess(cacheContext);
|
|
6490
6684
|
}
|
|
6491
6685
|
}
|
|
6492
|
-
return ResponseHandler.generateAuthenticationResult(this.cryptoObj, authority, cacheRecord, false, request, this.performanceClient,
|
|
6686
|
+
return ResponseHandler.generateAuthenticationResult(this.cryptoObj, authority, cacheRecord, false, request, this.performanceClient, {
|
|
6687
|
+
idTokenClaims,
|
|
6688
|
+
requestState: requestStateObj,
|
|
6689
|
+
serverTokenResponse,
|
|
6690
|
+
requestId: serverRequestId,
|
|
6691
|
+
tokenBindingKeyManager: this.tokenBindingKeyManager,
|
|
6692
|
+
});
|
|
6493
6693
|
}
|
|
6494
6694
|
/**
|
|
6495
6695
|
* Generates CacheRecord
|
|
@@ -6585,7 +6785,8 @@ class ResponseHandler {
|
|
|
6585
6785
|
* @param fromTokenCache
|
|
6586
6786
|
* @param stateString
|
|
6587
6787
|
*/
|
|
6588
|
-
static async generateAuthenticationResult(cryptoObj, authority, cacheRecord, fromTokenCache, request, performanceClient,
|
|
6788
|
+
static async generateAuthenticationResult(cryptoObj, authority, cacheRecord, fromTokenCache, request, performanceClient, options = {}) {
|
|
6789
|
+
const { idTokenClaims, requestState, serverTokenResponse, requestId, tokenBindingKeyManager = DEFAULT_TOKEN_BINDING_KEY_MANAGER, } = options;
|
|
6589
6790
|
let accessToken = "";
|
|
6590
6791
|
let responseScopes = [];
|
|
6591
6792
|
let expiresOn = null;
|
|
@@ -6600,7 +6801,7 @@ class ResponseHandler {
|
|
|
6600
6801
|
if (cacheRecord.accessToken.tokenType ===
|
|
6601
6802
|
AuthenticationScheme.POP &&
|
|
6602
6803
|
!request.popKid) {
|
|
6603
|
-
const popTokenGenerator = new PopTokenGenerator(cryptoObj, performanceClient);
|
|
6804
|
+
const popTokenGenerator = new PopTokenGenerator(cryptoObj, tokenBindingKeyManager, performanceClient);
|
|
6604
6805
|
const { secret, keyId } = cacheRecord.accessToken;
|
|
6605
6806
|
if (!keyId) {
|
|
6606
6807
|
throw createClientAuthError(keyIdMissing, request.correlationId);
|
|
@@ -7049,7 +7250,7 @@ class AuthorizationCodeClient {
|
|
|
7049
7250
|
const response = await invokeAsync(this.executeTokenRequest.bind(this), AuthClientExecuteTokenRequest, this.logger, this.performanceClient, request.correlationId)(this.authority, request, this.serverTelemetryManager);
|
|
7050
7251
|
// Retrieve requestId from response headers
|
|
7051
7252
|
const requestId = response.headers?.[HeaderNames.X_MS_REQUEST_ID];
|
|
7052
|
-
const responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.performanceClient, this.config.serializableCache, this.config.persistencePlugin);
|
|
7253
|
+
const responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.performanceClient, this.config.serializableCache, this.config.persistencePlugin, this.config.tokenBindingKeyManager);
|
|
7053
7254
|
// Validate response. This function throws a server error if an error is returned by the server.
|
|
7054
7255
|
responseHandler.validateTokenResponse(response.body, request.correlationId);
|
|
7055
7256
|
return invokeAsync(responseHandler.handleServerTokenResponse.bind(responseHandler), HandleServerTokenResponse, this.logger, this.performanceClient, request.correlationId)(response.body, this.authority, reqTimestamp, request, apiId, authCodePayload, undefined, undefined, undefined, requestId);
|
|
@@ -7150,7 +7351,7 @@ class AuthorizationCodeClient {
|
|
|
7150
7351
|
addGrantType(parameters, GrantType.AUTHORIZATION_CODE_GRANT);
|
|
7151
7352
|
addClientInfo(parameters);
|
|
7152
7353
|
if (request.authenticationScheme === AuthenticationScheme.POP) {
|
|
7153
|
-
const popTokenGenerator = new PopTokenGenerator(this.cryptoUtils, this.performanceClient);
|
|
7354
|
+
const popTokenGenerator = new PopTokenGenerator(this.cryptoUtils, this.config.tokenBindingKeyManager, this.performanceClient);
|
|
7154
7355
|
let reqCnfData;
|
|
7155
7356
|
if (!request.popKid) {
|
|
7156
7357
|
const generatedReqCnfData = await invokeAsync(popTokenGenerator.generateCnf.bind(popTokenGenerator), PopTokenGenerateCnf, this.logger, this.performanceClient, request.correlationId)(request, this.logger);
|
|
@@ -7295,7 +7496,7 @@ class RefreshTokenClient {
|
|
|
7295
7496
|
const response = await invokeAsync(this.executeTokenRequest.bind(this), RefreshTokenClientExecuteTokenRequest, this.logger, this.performanceClient, request.correlationId)(request, this.authority);
|
|
7296
7497
|
// Retrieve requestId from response headers
|
|
7297
7498
|
const requestId = response.headers?.[HeaderNames.X_MS_REQUEST_ID];
|
|
7298
|
-
const responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.performanceClient, this.config.serializableCache, this.config.persistencePlugin);
|
|
7499
|
+
const responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.performanceClient, this.config.serializableCache, this.config.persistencePlugin, this.config.tokenBindingKeyManager);
|
|
7299
7500
|
responseHandler.validateTokenResponse(response.body, request.correlationId);
|
|
7300
7501
|
return invokeAsync(responseHandler.handleServerTokenResponse.bind(responseHandler), HandleServerTokenResponse, this.logger, this.performanceClient, request.correlationId)(response.body, this.authority, reqTimestamp, request, apiId, undefined, undefined, true, request.forceCache, requestId);
|
|
7301
7502
|
}
|
|
@@ -7436,7 +7637,7 @@ class RefreshTokenClient {
|
|
|
7436
7637
|
addClientAssertionType(parameters, clientAssertion.assertionType);
|
|
7437
7638
|
}
|
|
7438
7639
|
if (request.authenticationScheme === AuthenticationScheme.POP) {
|
|
7439
|
-
const popTokenGenerator = new PopTokenGenerator(this.cryptoUtils, this.performanceClient);
|
|
7640
|
+
const popTokenGenerator = new PopTokenGenerator(this.cryptoUtils, this.config.tokenBindingKeyManager, this.performanceClient);
|
|
7440
7641
|
let reqCnfData;
|
|
7441
7642
|
if (!request.popKid) {
|
|
7442
7643
|
const generatedReqCnfData = await invokeAsync(popTokenGenerator.generateCnf.bind(popTokenGenerator), PopTokenGenerateCnf, this.logger, this.performanceClient, request.correlationId)(request, this.logger);
|
|
@@ -7589,7 +7790,10 @@ class SilentFlowClient {
|
|
|
7589
7790
|
if (cacheRecord.idToken) {
|
|
7590
7791
|
idTokenClaims = extractTokenClaims(cacheRecord.idToken.secret, this.config.cryptoInterface.base64Decode, request.correlationId);
|
|
7591
7792
|
}
|
|
7592
|
-
return ResponseHandler.generateAuthenticationResult(this.cryptoUtils, this.authority, cacheRecord, true, request, this.performanceClient,
|
|
7793
|
+
return ResponseHandler.generateAuthenticationResult(this.cryptoUtils, this.authority, cacheRecord, true, request, this.performanceClient, {
|
|
7794
|
+
idTokenClaims,
|
|
7795
|
+
tokenBindingKeyManager: this.config.tokenBindingKeyManager,
|
|
7796
|
+
});
|
|
7593
7797
|
}
|
|
7594
7798
|
}
|
|
7595
7799
|
|
|
@@ -8286,12 +8490,14 @@ exports.ClientConfigurationErrorCodes = ClientConfigurationErrorCodes;
|
|
|
8286
8490
|
exports.Constants = Constants;
|
|
8287
8491
|
exports.DEFAULT_CRYPTO_IMPLEMENTATION = DEFAULT_CRYPTO_IMPLEMENTATION;
|
|
8288
8492
|
exports.DEFAULT_SYSTEM_OPTIONS = DEFAULT_SYSTEM_OPTIONS;
|
|
8493
|
+
exports.DEFAULT_TOKEN_BINDING_KEY_MANAGER = DEFAULT_TOKEN_BINDING_KEY_MANAGER;
|
|
8289
8494
|
exports.DefaultStorageClass = DefaultStorageClass;
|
|
8290
8495
|
exports.EXT_FIELD_PREFIX = EXT_FIELD_PREFIX;
|
|
8291
8496
|
exports.IntFields = IntFields;
|
|
8292
8497
|
exports.InteractionRequiredAuthError = InteractionRequiredAuthError;
|
|
8293
8498
|
exports.InteractionRequiredAuthErrorCodes = InteractionRequiredAuthErrorCodes;
|
|
8294
|
-
exports.
|
|
8499
|
+
exports.JoseHeader = JoseHeader;
|
|
8500
|
+
exports.JsonWebTokenAlgorithms = JsonWebTokenAlgorithms;
|
|
8295
8501
|
exports.Logger = Logger;
|
|
8296
8502
|
exports.NetworkError = NetworkError;
|
|
8297
8503
|
exports.PerformanceEventStatus = PerformanceEventStatus;
|
|
@@ -8340,4 +8546,4 @@ exports.invokeAsync = invokeAsync;
|
|
|
8340
8546
|
exports.tenantIdMatchesHomeTenant = tenantIdMatchesHomeTenant;
|
|
8341
8547
|
exports.updateAccountTenantProfileData = updateAccountTenantProfileData;
|
|
8342
8548
|
exports.version = version;
|
|
8343
|
-
//# sourceMappingURL=index-node-
|
|
8549
|
+
//# sourceMappingURL=index-node-BaODPZEy.js.map
|