@azure/msal-common 16.13.0 → 16.14.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 +2 -4
- package/dist/authority/Authority.mjs.map +1 -1
- package/dist/authority/AuthorityFactory.mjs +1 -1
- package/dist/authority/AuthorityMetadata.mjs +1 -10
- package/dist/authority/AuthorityMetadata.mjs.map +1 -1
- package/dist/authority/AuthorityOptions.mjs +1 -3
- package/dist/authority/AuthorityOptions.mjs.map +1 -1
- package/dist/authority/AuthorityType.mjs +1 -2
- package/dist/authority/AuthorityType.mjs.map +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 +22 -17
- package/dist/cache/CacheManager.mjs.map +1 -1
- package/dist/cache/persistence/TokenCacheContext.mjs +1 -1
- package/dist/cache/utils/AccountEntityUtils.mjs +3 -3
- package/dist/cache/utils/AccountEntityUtils.mjs.map +1 -1
- package/dist/cache/utils/CacheHelpers.mjs +1 -1
- package/dist/client/AuthorizationCodeClient.mjs +3 -2
- package/dist/client/AuthorizationCodeClient.mjs.map +1 -1
- package/dist/client/RefreshTokenClient.mjs +10 -2
- package/dist/client/RefreshTokenClient.mjs.map +1 -1
- package/dist/client/SilentFlowClient.mjs +18 -2
- package/dist/client/SilentFlowClient.mjs.map +1 -1
- package/dist/config/ClientConfiguration.mjs +4 -3
- package/dist/config/ClientConfiguration.mjs.map +1 -1
- package/dist/constants/AADServerParamKeys.mjs +3 -2
- package/dist/constants/AADServerParamKeys.mjs.map +1 -1
- package/dist/crypto/DpopProofGenerator.mjs +153 -0
- package/dist/crypto/DpopProofGenerator.mjs.map +1 -0
- package/dist/crypto/ICrypto.mjs +1 -1
- package/dist/crypto/ITokenBindingKeyManager.mjs +1 -1
- package/dist/crypto/ITokenBindingKeyManager.mjs.map +1 -1
- package/dist/crypto/JoseHeader.mjs +1 -1
- package/dist/crypto/JoseHeader.mjs.map +1 -1
- package/dist/crypto/PopTokenGenerator.mjs +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 +3 -2
- package/dist/error/ClientAuthErrorCodes.mjs.map +1 -1
- package/dist/error/ClientConfigurationError.mjs +1 -1
- package/dist/error/ClientConfigurationErrorCodes.mjs +5 -3
- 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 +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 +1 -1
- package/dist/index.mjs +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 +22 -4
- package/dist/protocol/Token.mjs.map +1 -1
- package/dist/request/AuthenticationHeaderParser.mjs +1 -1
- package/dist/request/BaseAuthRequest.mjs +1 -1
- package/dist/request/BaseAuthRequest.mjs.map +1 -1
- package/dist/request/RequestParameterBuilder.mjs +8 -4
- package/dist/request/RequestParameterBuilder.mjs.map +1 -1
- package/dist/request/ScopeSet.mjs +1 -1
- package/dist/response/ResponseHandler.mjs +46 -4
- 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 +5 -3
- package/dist/utils/Constants.mjs.map +1 -1
- package/dist/utils/FunctionWrappers.mjs +1 -1
- package/dist/utils/ObjectUtils.mjs +1 -1
- 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 +2 -4
- package/dist-browser/authority/Authority.mjs.map +1 -1
- package/dist-browser/authority/AuthorityFactory.mjs +1 -1
- package/dist-browser/authority/AuthorityMetadata.mjs +1 -10
- package/dist-browser/authority/AuthorityMetadata.mjs.map +1 -1
- package/dist-browser/authority/AuthorityOptions.mjs +1 -3
- package/dist-browser/authority/AuthorityOptions.mjs.map +1 -1
- package/dist-browser/authority/AuthorityType.mjs +1 -2
- package/dist-browser/authority/AuthorityType.mjs.map +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 +22 -17
- 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 +3 -3
- package/dist-browser/cache/utils/AccountEntityUtils.mjs.map +1 -1
- package/dist-browser/cache/utils/CacheHelpers.mjs +1 -1
- package/dist-browser/client/AuthorizationCodeClient.mjs +3 -2
- package/dist-browser/client/AuthorizationCodeClient.mjs.map +1 -1
- package/dist-browser/client/RefreshTokenClient.mjs +10 -2
- package/dist-browser/client/RefreshTokenClient.mjs.map +1 -1
- package/dist-browser/client/SilentFlowClient.mjs +18 -2
- package/dist-browser/client/SilentFlowClient.mjs.map +1 -1
- package/dist-browser/config/ClientConfiguration.mjs +4 -3
- package/dist-browser/config/ClientConfiguration.mjs.map +1 -1
- package/dist-browser/constants/AADServerParamKeys.mjs +3 -2
- package/dist-browser/constants/AADServerParamKeys.mjs.map +1 -1
- package/dist-browser/crypto/DpopProofGenerator.mjs +153 -0
- package/dist-browser/crypto/DpopProofGenerator.mjs.map +1 -0
- package/dist-browser/crypto/ICrypto.mjs +1 -1
- package/dist-browser/crypto/ITokenBindingKeyManager.mjs +1 -1
- package/dist-browser/crypto/ITokenBindingKeyManager.mjs.map +1 -1
- package/dist-browser/crypto/JoseHeader.mjs +1 -1
- package/dist-browser/crypto/JoseHeader.mjs.map +1 -1
- package/dist-browser/crypto/PopTokenGenerator.mjs +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 +3 -2
- package/dist-browser/error/ClientAuthErrorCodes.mjs.map +1 -1
- package/dist-browser/error/ClientConfigurationError.mjs +1 -1
- package/dist-browser/error/ClientConfigurationErrorCodes.mjs +5 -3
- 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 +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 +1 -1
- package/dist-browser/index.mjs +1 -1
- package/dist-browser/log-strings-mapping.json +13 -5
- 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 +22 -4
- package/dist-browser/protocol/Token.mjs.map +1 -1
- package/dist-browser/request/AuthenticationHeaderParser.mjs +1 -1
- package/dist-browser/request/BaseAuthRequest.mjs +1 -1
- package/dist-browser/request/BaseAuthRequest.mjs.map +1 -1
- package/dist-browser/request/RequestParameterBuilder.mjs +8 -4
- package/dist-browser/request/RequestParameterBuilder.mjs.map +1 -1
- package/dist-browser/request/ScopeSet.mjs +1 -1
- package/dist-browser/response/ResponseHandler.mjs +46 -4
- 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 +5 -3
- package/dist-browser/utils/Constants.mjs.map +1 -1
- package/dist-browser/utils/FunctionWrappers.mjs +1 -1
- package/dist-browser/utils/ObjectUtils.mjs +1 -1
- 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 +2 -2
- package/lib/{index-node-BaODPZEy.js → index-node-l_NIe8t5.js} +276 -45
- package/lib/index-node-l_NIe8t5.js.map +1 -0
- package/lib/index-node.cjs +2 -2
- package/lib/index.cjs +2 -2
- package/package.json +1 -1
- package/src/authority/Authority.ts +0 -2
- package/src/authority/AuthorityMetadata.ts +0 -9
- package/src/authority/AuthorityOptions.ts +0 -3
- package/src/authority/AuthorityType.ts +0 -1
- package/src/cache/CacheManager.ts +32 -27
- package/src/cache/utils/AccountEntityUtils.ts +2 -2
- package/src/client/AuthorizationCodeClient.ts +8 -0
- package/src/client/RefreshTokenClient.ts +22 -0
- package/src/client/SilentFlowClient.ts +40 -1
- package/src/config/ClientConfiguration.ts +6 -3
- package/src/constants/AADServerParamKeys.ts +1 -0
- package/src/crypto/DpopProofGenerator.ts +44 -5
- package/src/crypto/ITokenBindingKeyManager.ts +3 -2
- package/src/crypto/JoseHeader.ts +3 -2
- package/src/crypto/PublicJsonWebKey.ts +24 -0
- package/src/error/ClientAuthErrorCodes.ts +1 -0
- package/src/error/ClientConfigurationErrorCodes.ts +2 -0
- package/src/exports-common.ts +1 -0
- package/src/packageMetadata.ts +1 -1
- package/src/protocol/Token.ts +44 -1
- package/src/request/BaseAuthRequest.ts +5 -0
- package/src/request/CommonAuthorizationUrlRequest.ts +5 -0
- package/src/request/RequestParameterBuilder.ts +7 -3
- package/src/response/AuthenticationResult.ts +2 -0
- package/src/response/ResponseHandler.ts +72 -2
- package/src/telemetry/performance/PerformanceEvent.ts +12 -0
- package/src/utils/Constants.ts +3 -1
- package/types/authority/Authority.d.ts.map +1 -1
- package/types/authority/AuthorityMetadata.d.ts.map +1 -1
- package/types/authority/AuthorityOptions.d.ts +0 -1
- package/types/authority/AuthorityOptions.d.ts.map +1 -1
- package/types/authority/AuthorityType.d.ts +0 -1
- package/types/authority/AuthorityType.d.ts.map +1 -1
- package/types/cache/CacheManager.d.ts +3 -1
- package/types/cache/CacheManager.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.map +1 -1
- package/types/constants/AADServerParamKeys.d.ts +1 -0
- package/types/constants/AADServerParamKeys.d.ts.map +1 -1
- package/types/crypto/DpopProofGenerator.d.ts +8 -2
- package/types/crypto/DpopProofGenerator.d.ts.map +1 -1
- package/types/crypto/ITokenBindingKeyManager.d.ts +2 -1
- package/types/crypto/ITokenBindingKeyManager.d.ts.map +1 -1
- package/types/crypto/JoseHeader.d.ts +3 -2
- package/types/crypto/JoseHeader.d.ts.map +1 -1
- package/types/crypto/PublicJsonWebKey.d.ts +20 -0
- package/types/crypto/PublicJsonWebKey.d.ts.map +1 -0
- package/types/error/ClientAuthErrorCodes.d.ts +1 -0
- package/types/error/ClientAuthErrorCodes.d.ts.map +1 -1
- package/types/error/ClientConfigurationErrorCodes.d.ts +2 -0
- package/types/error/ClientConfigurationErrorCodes.d.ts.map +1 -1
- package/types/exports-common.d.ts +1 -0
- package/types/exports-common.d.ts.map +1 -1
- package/types/packageMetadata.d.ts +1 -1
- package/types/protocol/Token.d.ts +7 -0
- package/types/protocol/Token.d.ts.map +1 -1
- package/types/request/BaseAuthRequest.d.ts +5 -0
- package/types/request/BaseAuthRequest.d.ts.map +1 -1
- package/types/request/CommonAuthorizationUrlRequest.d.ts +5 -0
- package/types/request/CommonAuthorizationUrlRequest.d.ts.map +1 -1
- package/types/request/RequestParameterBuilder.d.ts +2 -2
- package/types/request/RequestParameterBuilder.d.ts.map +1 -1
- package/types/response/AuthenticationResult.d.ts +2 -0
- package/types/response/AuthenticationResult.d.ts.map +1 -1
- package/types/response/ResponseHandler.d.ts.map +1 -1
- package/types/telemetry/performance/PerformanceEvent.d.ts +10 -0
- package/types/telemetry/performance/PerformanceEvent.d.ts.map +1 -1
- package/types/utils/Constants.d.ts +3 -1
- package/types/utils/Constants.d.ts.map +1 -1
- package/lib/index-node-BaODPZEy.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-common v16.
|
|
1
|
+
/*! @azure/msal-common v16.14.0 2026-08-28 */
|
|
2
2
|
'use strict';
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
@@ -74,6 +74,7 @@ const invalidCacheEnvironment = "invalid_cache_environment";
|
|
|
74
74
|
const noAccountFound = "no_account_found";
|
|
75
75
|
const noCryptoObject = "no_crypto_object";
|
|
76
76
|
const unexpectedCredentialType = "unexpected_credential_type";
|
|
77
|
+
const dpopTokenTypeMismatch = "dpop_token_type_mismatch";
|
|
77
78
|
const tokenRefreshRequired = "token_refresh_required";
|
|
78
79
|
const tokenClaimsCnfRequiredForSignedJwt = "token_claims_cnf_required_for_signedjwt";
|
|
79
80
|
const authorizationCodeMissingFromServerResponse = "authorization_code_missing_from_server_response";
|
|
@@ -96,6 +97,7 @@ var ClientAuthErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
96
97
|
cannotRemoveEmptyScope: cannotRemoveEmptyScope,
|
|
97
98
|
clientInfoDecodingError: clientInfoDecodingError,
|
|
98
99
|
clientInfoEmptyError: clientInfoEmptyError,
|
|
100
|
+
dpopTokenTypeMismatch: dpopTokenTypeMismatch,
|
|
99
101
|
emptyInputScopeSet: emptyInputScopeSet,
|
|
100
102
|
endSessionEndpointNotSupported: endSessionEndpointNotSupported,
|
|
101
103
|
endpointResolutionError: endpointResolutionError,
|
|
@@ -231,7 +233,6 @@ var AuthToken = /*#__PURE__*/Object.freeze({
|
|
|
231
233
|
const AuthorityType = {
|
|
232
234
|
Default: 0,
|
|
233
235
|
Adfs: 1,
|
|
234
|
-
Dsts: 2,
|
|
235
236
|
Ciam: 3,
|
|
236
237
|
};
|
|
237
238
|
|
|
@@ -277,7 +278,9 @@ const invalidPlatformBrokerConfiguration = "invalid_platform_broker_configuratio
|
|
|
277
278
|
const issuerValidationFailed = "issuer_validation_failed";
|
|
278
279
|
const invalidResponseMode = "invalid_response_mode";
|
|
279
280
|
const invalidDpopHtm = "invalid_dpop_htm";
|
|
280
|
-
const invalidDpopHtu = "invalid_dpop_htu";
|
|
281
|
+
const invalidDpopHtu = "invalid_dpop_htu";
|
|
282
|
+
const invalidDpopNonce = "invalid_dpop_nonce";
|
|
283
|
+
const dpopMissingResourceContext = "dpop_missing_resource_context";
|
|
281
284
|
|
|
282
285
|
var ClientConfigurationErrorCodes = /*#__PURE__*/Object.freeze({
|
|
283
286
|
__proto__: null,
|
|
@@ -286,6 +289,7 @@ var ClientConfigurationErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
286
289
|
cannotAllowPlatformBroker: cannotAllowPlatformBroker,
|
|
287
290
|
cannotSetOIDCOptions: cannotSetOIDCOptions,
|
|
288
291
|
claimsRequestParsingError: claimsRequestParsingError,
|
|
292
|
+
dpopMissingResourceContext: dpopMissingResourceContext,
|
|
289
293
|
emptyInputScopesError: emptyInputScopesError,
|
|
290
294
|
invalidAuthenticationHeader: invalidAuthenticationHeader,
|
|
291
295
|
invalidAuthorityMetadata: invalidAuthorityMetadata,
|
|
@@ -294,6 +298,7 @@ var ClientConfigurationErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
294
298
|
invalidCodeChallengeMethod: invalidCodeChallengeMethod,
|
|
295
299
|
invalidDpopHtm: invalidDpopHtm,
|
|
296
300
|
invalidDpopHtu: invalidDpopHtu,
|
|
301
|
+
invalidDpopNonce: invalidDpopNonce,
|
|
297
302
|
invalidPlatformBrokerConfiguration: invalidPlatformBrokerConfiguration,
|
|
298
303
|
invalidRequestMethodForEAR: invalidRequestMethodForEAR,
|
|
299
304
|
invalidResponseMode: invalidResponseMode,
|
|
@@ -419,7 +424,6 @@ const DEFAULT_AUTHORITY_HOST = "login.microsoftonline.com";
|
|
|
419
424
|
const DEFAULT_COMMON_TENANT = "common";
|
|
420
425
|
// ADFS String
|
|
421
426
|
const ADFS = "adfs";
|
|
422
|
-
const DSTS = "dstsv2";
|
|
423
427
|
// Default AAD Instance Discovery Endpoint
|
|
424
428
|
const AAD_INSTANCE_DISCOVERY_ENDPT = `${DEFAULT_AUTHORITY}discovery/instance?api-version=1.1&authorization_endpoint=`;
|
|
425
429
|
// CIAM URL
|
|
@@ -489,6 +493,7 @@ const OIDC_SCOPES = [...OIDC_DEFAULT_SCOPES, EMAIL_SCOPE];
|
|
|
489
493
|
const HeaderNames = {
|
|
490
494
|
CONTENT_TYPE: "Content-Type",
|
|
491
495
|
CONTENT_LENGTH: "Content-Length",
|
|
496
|
+
DPOP: "DPoP",
|
|
492
497
|
RETRY_AFTER: "Retry-After",
|
|
493
498
|
CCS_HEADER: "X-AnchorMailbox",
|
|
494
499
|
WWWAuthenticate: "WWW-Authenticate",
|
|
@@ -519,6 +524,7 @@ const ClaimsRequestKeys = {
|
|
|
519
524
|
ID_TOKEN: "id_token",
|
|
520
525
|
SIGNIN_STATE: "signin_state",
|
|
521
526
|
LOGIN_HINT: "login_hint",
|
|
527
|
+
TENANT_REGION_SUB_SCOPE: "tenant_region_sub_scope",
|
|
522
528
|
};
|
|
523
529
|
/**
|
|
524
530
|
* we considered making this "enum" in the request instead of string, however it looks like the allowed list of
|
|
@@ -634,6 +640,7 @@ const SERVER_TELEM_UNKNOWN_ERROR = "unknown_error";
|
|
|
634
640
|
const AuthenticationScheme = {
|
|
635
641
|
BEARER: "Bearer",
|
|
636
642
|
POP: "pop",
|
|
643
|
+
DPOP: "DPoP",
|
|
637
644
|
SSH: "ssh-cert",
|
|
638
645
|
};
|
|
639
646
|
/**
|
|
@@ -742,7 +749,6 @@ var Constants = /*#__PURE__*/Object.freeze({
|
|
|
742
749
|
DEFAULT_MAX_THROTTLE_TIME_SECONDS: DEFAULT_MAX_THROTTLE_TIME_SECONDS,
|
|
743
750
|
DEFAULT_THROTTLE_TIME_SECONDS: DEFAULT_THROTTLE_TIME_SECONDS,
|
|
744
751
|
DEFAULT_TOKEN_RENEWAL_OFFSET_SEC: DEFAULT_TOKEN_RENEWAL_OFFSET_SEC,
|
|
745
|
-
DSTS: DSTS,
|
|
746
752
|
EMAIL_SCOPE: EMAIL_SCOPE,
|
|
747
753
|
EncodingTypes: EncodingTypes,
|
|
748
754
|
FORWARD_SLASH: FORWARD_SLASH,
|
|
@@ -1048,15 +1054,6 @@ const rawMetdataJSON = {
|
|
|
1048
1054
|
preferred_cache: "login.sovcloud-identity.sg",
|
|
1049
1055
|
aliases: ["login.sovcloud-identity.sg"],
|
|
1050
1056
|
},
|
|
1051
|
-
{
|
|
1052
|
-
preferred_network: "login.windows-ppe.net",
|
|
1053
|
-
preferred_cache: "login.windows-ppe.net",
|
|
1054
|
-
aliases: [
|
|
1055
|
-
"login.windows-ppe.net",
|
|
1056
|
-
"sts.windows-ppe.net",
|
|
1057
|
-
"login.microsoft-ppe.com",
|
|
1058
|
-
],
|
|
1059
|
-
},
|
|
1060
1057
|
],
|
|
1061
1058
|
},
|
|
1062
1059
|
};
|
|
@@ -1160,8 +1157,6 @@ const AzureCloudInstance = {
|
|
|
1160
1157
|
None: "none",
|
|
1161
1158
|
// Microsoft Azure public cloud
|
|
1162
1159
|
AzurePublic: "https://login.microsoftonline.com",
|
|
1163
|
-
// Microsoft PPE
|
|
1164
|
-
AzurePpe: "https://login.windows-ppe.net",
|
|
1165
1160
|
// Microsoft Chinese national/regional cloud
|
|
1166
1161
|
AzureChina: "https://login.chinacloudapi.cn",
|
|
1167
1162
|
// Microsoft German national/regional cloud ("Black Forest")
|
|
@@ -1920,8 +1915,6 @@ class Authority {
|
|
|
1920
1915
|
switch (pathSegments[0].toLowerCase()) {
|
|
1921
1916
|
case ADFS:
|
|
1922
1917
|
return AuthorityType.Adfs;
|
|
1923
|
-
case DSTS:
|
|
1924
|
-
return AuthorityType.Dsts;
|
|
1925
1918
|
}
|
|
1926
1919
|
}
|
|
1927
1920
|
return AuthorityType.Default;
|
|
@@ -3057,6 +3050,7 @@ const CLIENT_ASSERTION = "client_assertion";
|
|
|
3057
3050
|
const CLIENT_ASSERTION_TYPE = "client_assertion_type";
|
|
3058
3051
|
const TOKEN_TYPE = "token_type";
|
|
3059
3052
|
const REQ_CNF = "req_cnf";
|
|
3053
|
+
const DPOP_JKT = "dpop_jkt";
|
|
3060
3054
|
const OBO_ASSERTION = "assertion";
|
|
3061
3055
|
const REQUESTED_TOKEN_USE = "requested_token_use";
|
|
3062
3056
|
const ON_BEHALF_OF = "on_behalf_of";
|
|
@@ -3103,6 +3097,7 @@ var AADServerParamKeys = /*#__PURE__*/Object.freeze({
|
|
|
3103
3097
|
CODE_VERIFIER: CODE_VERIFIER,
|
|
3104
3098
|
DEVICE_CODE: DEVICE_CODE,
|
|
3105
3099
|
DOMAIN_HINT: DOMAIN_HINT,
|
|
3100
|
+
DPOP_JKT: DPOP_JKT,
|
|
3106
3101
|
EAR_JWE_CRYPTO: EAR_JWE_CRYPTO,
|
|
3107
3102
|
EAR_JWK: EAR_JWK,
|
|
3108
3103
|
ERROR: ERROR,
|
|
@@ -3470,8 +3465,8 @@ function createAccountEntityFromAccountInfo(accountInfo, cloudGraphHostName, msG
|
|
|
3470
3465
|
* @param authType
|
|
3471
3466
|
*/
|
|
3472
3467
|
function generateHomeAccountId(serverClientInfo, authType, logger, cryptoObj, correlationId, idTokenClaims) {
|
|
3473
|
-
//
|
|
3474
|
-
if (
|
|
3468
|
+
// ADFS does not have tid and does not set client_info
|
|
3469
|
+
if (authType !== AuthorityType.Adfs) {
|
|
3475
3470
|
// for cases where there is clientInfo
|
|
3476
3471
|
if (serverClientInfo) {
|
|
3477
3472
|
try {
|
|
@@ -4022,11 +4017,15 @@ function addExtraParameters(parameters, extraParams) {
|
|
|
4022
4017
|
}
|
|
4023
4018
|
/**
|
|
4024
4019
|
* Default optional idToken claims requested on all auth requests.
|
|
4025
|
-
* signin_state enables KMSI detection; login_hint enables login hint propagation
|
|
4020
|
+
* signin_state enables KMSI detection; login_hint enables login hint propagation;
|
|
4021
|
+
* tenant_region_sub_scope identifies the sovereign enclave a tenant belongs to.
|
|
4026
4022
|
*/
|
|
4027
4023
|
const DEFAULT_ID_TOKEN_CLAIMS = {
|
|
4028
4024
|
[ClaimsRequestKeys.SIGNIN_STATE]: { essential: false },
|
|
4029
4025
|
[ClaimsRequestKeys.LOGIN_HINT]: { essential: false },
|
|
4026
|
+
[ClaimsRequestKeys.TENANT_REGION_SUB_SCOPE]: {
|
|
4027
|
+
essential: false,
|
|
4028
|
+
},
|
|
4030
4029
|
};
|
|
4031
4030
|
/**
|
|
4032
4031
|
* Parses a claims JSON string into an object, throwing a ClientConfigurationError
|
|
@@ -4085,8 +4084,8 @@ function deepMergeClaims(baseClaims, claimsToMerge) {
|
|
|
4085
4084
|
/**
|
|
4086
4085
|
* Parses claims JSON, optionally deep-merges a second client-originated claims string
|
|
4087
4086
|
* (`claimsToMerge`, e.g. `claimsFromClient`) with precedence on conflicting keys, merges
|
|
4088
|
-
* default optional idToken claims (signin_state, login_hint), and appends client
|
|
4089
|
-
* capabilities (xms_cc) to the access_token section
|
|
4087
|
+
* default optional idToken claims (signin_state, login_hint, tenant_region_sub_scope), and appends client
|
|
4088
|
+
* capabilities (xms_cc) to the access_token section
|
|
4090
4089
|
* Does not overwrite idToken claims already specified by the caller.
|
|
4091
4090
|
* @param claims - Existing claims JSON string from the request (may be undefined)
|
|
4092
4091
|
* @param clientCapabilities - Client capabilities array from configuration
|
|
@@ -4633,7 +4632,7 @@ class Logger {
|
|
|
4633
4632
|
|
|
4634
4633
|
/* eslint-disable header/header */
|
|
4635
4634
|
const name = "@azure/msal-common";
|
|
4636
|
-
const version = "16.
|
|
4635
|
+
const version = "16.14.0";
|
|
4637
4636
|
|
|
4638
4637
|
/*
|
|
4639
4638
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4693,9 +4692,10 @@ function createCacheError(e) {
|
|
|
4693
4692
|
* @internal
|
|
4694
4693
|
*/
|
|
4695
4694
|
class CacheManager {
|
|
4696
|
-
constructor(clientId, cryptoImpl, logger, performanceClient, staticAuthorityOptions) {
|
|
4695
|
+
constructor(clientId, cryptoImpl, logger, performanceClient, staticAuthorityOptions, tokenBindingKeyManager) {
|
|
4697
4696
|
this.clientId = clientId;
|
|
4698
4697
|
this.cryptoImpl = cryptoImpl;
|
|
4698
|
+
this.tokenBindingKeyManager = tokenBindingKeyManager;
|
|
4699
4699
|
this.commonLogger = logger.clone(name, version);
|
|
4700
4700
|
this.staticAuthorityOptions = staticAuthorityOptions;
|
|
4701
4701
|
this.performanceClient = performanceClient;
|
|
@@ -5184,19 +5184,24 @@ class CacheManager {
|
|
|
5184
5184
|
}
|
|
5185
5185
|
this.removeItem(key, correlationId);
|
|
5186
5186
|
this.performanceClient.incrementFields({ accessTokensRemoved: 1 }, correlationId);
|
|
5187
|
-
// Remove Token Binding Key from key store for
|
|
5187
|
+
// Remove Token Binding Key from key store for token-bound access token credentials
|
|
5188
5188
|
if (credential.credentialType.toLowerCase() ===
|
|
5189
5189
|
CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()) {
|
|
5190
|
-
|
|
5191
|
-
|
|
5192
|
-
|
|
5193
|
-
|
|
5194
|
-
|
|
5195
|
-
|
|
5196
|
-
|
|
5197
|
-
this.
|
|
5198
|
-
|
|
5199
|
-
|
|
5190
|
+
const tokenType = credential.tokenType?.toLowerCase();
|
|
5191
|
+
switch (tokenType) {
|
|
5192
|
+
case AuthenticationScheme.POP:
|
|
5193
|
+
case AuthenticationScheme.DPOP.toLowerCase(): {
|
|
5194
|
+
const accessTokenWithAuthSchemeEntity = credential;
|
|
5195
|
+
const kid = accessTokenWithAuthSchemeEntity.keyId;
|
|
5196
|
+
if (kid) {
|
|
5197
|
+
void this.tokenBindingKeyManager
|
|
5198
|
+
.removeTokenBindingKey(kid, correlationId)
|
|
5199
|
+
.catch(() => {
|
|
5200
|
+
this.commonLogger.error("Failed to remove token binding key", correlationId);
|
|
5201
|
+
this.performanceClient?.incrementFields({ removeTokenBindingKeyFailure: 1 }, correlationId);
|
|
5202
|
+
});
|
|
5203
|
+
}
|
|
5204
|
+
break;
|
|
5200
5205
|
}
|
|
5201
5206
|
}
|
|
5202
5207
|
}
|
|
@@ -5737,16 +5742,15 @@ class CacheManager {
|
|
|
5737
5742
|
}
|
|
5738
5743
|
switch (normalizedFilterTokenType) {
|
|
5739
5744
|
case "dpop":
|
|
5740
|
-
return this.matchKeyBoundAccessToken(entity, filter, true);
|
|
5741
5745
|
case AuthenticationScheme.SSH:
|
|
5742
|
-
return this.matchKeyBoundAccessToken(entity, filter
|
|
5746
|
+
return this.matchKeyBoundAccessToken(entity, filter);
|
|
5743
5747
|
default:
|
|
5744
5748
|
return true;
|
|
5745
5749
|
}
|
|
5746
5750
|
}
|
|
5747
|
-
matchKeyBoundAccessToken(entity, filter
|
|
5751
|
+
matchKeyBoundAccessToken(entity, filter) {
|
|
5748
5752
|
if (!filter.keyId) {
|
|
5749
|
-
return
|
|
5753
|
+
return true;
|
|
5750
5754
|
}
|
|
5751
5755
|
return this.matchKeyId(entity, filter.keyId);
|
|
5752
5756
|
}
|
|
@@ -6043,15 +6047,16 @@ function buildClientConfiguration({ authOptions: userAuthOptions, systemOptions:
|
|
|
6043
6047
|
...DEFAULT_LOGGER_IMPLEMENTATION,
|
|
6044
6048
|
...userLoggerOption,
|
|
6045
6049
|
};
|
|
6050
|
+
const resolvedTokenBindingKeyManager = tokenBindingKeyManager || DEFAULT_TOKEN_BINDING_KEY_MANAGER;
|
|
6046
6051
|
return {
|
|
6047
6052
|
authOptions: buildAuthOptions(userAuthOptions),
|
|
6048
6053
|
systemOptions: { ...DEFAULT_SYSTEM_OPTIONS, ...userSystemOptions },
|
|
6049
6054
|
loggerOptions: loggerOptions,
|
|
6050
6055
|
storageInterface: storageImplementation ||
|
|
6051
|
-
new DefaultStorageClass(userAuthOptions.clientId, DEFAULT_CRYPTO_IMPLEMENTATION, new Logger(loggerOptions, name, version), new StubPerformanceClient()),
|
|
6056
|
+
new DefaultStorageClass(userAuthOptions.clientId, DEFAULT_CRYPTO_IMPLEMENTATION, new Logger(loggerOptions, name, version), new StubPerformanceClient(), undefined, resolvedTokenBindingKeyManager),
|
|
6052
6057
|
networkInterface: networkImplementation || DEFAULT_NETWORK_IMPLEMENTATION,
|
|
6053
6058
|
cryptoInterface: cryptoImplementation || DEFAULT_CRYPTO_IMPLEMENTATION,
|
|
6054
|
-
tokenBindingKeyManager:
|
|
6059
|
+
tokenBindingKeyManager: resolvedTokenBindingKeyManager,
|
|
6055
6060
|
clientCredentials: clientCredentials || DEFAULT_CLIENT_CREDENTIALS,
|
|
6056
6061
|
libraryInfo: { ...DEFAULT_LIBRARY_INFO, ...libraryInfo },
|
|
6057
6062
|
telemetry: { ...DEFAULT_TELEMETRY_OPTIONS, ...telemetry },
|
|
@@ -6322,6 +6327,149 @@ class PopTokenGenerator {
|
|
|
6322
6327
|
}
|
|
6323
6328
|
}
|
|
6324
6329
|
|
|
6330
|
+
/*
|
|
6331
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6332
|
+
* Licensed under the MIT License.
|
|
6333
|
+
*/
|
|
6334
|
+
const DPOP_HTM_REGEX = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;
|
|
6335
|
+
const DPOP_TOKEN_BINDING_KEY_TYPE = "dpop";
|
|
6336
|
+
const DPOP_JWT_HEADER_ALGORITHM = JsonWebTokenAlgorithms.ES256;
|
|
6337
|
+
function buildProofHeader(publicJwk, correlationId) {
|
|
6338
|
+
return JoseHeader.getDpopHeader({
|
|
6339
|
+
alg: DPOP_JWT_HEADER_ALGORITHM,
|
|
6340
|
+
jwk: publicJwk,
|
|
6341
|
+
}, correlationId);
|
|
6342
|
+
}
|
|
6343
|
+
function normalizeHtm(htm, correlationId) {
|
|
6344
|
+
if (typeof htm !== "string" || !DPOP_HTM_REGEX.test(htm)) {
|
|
6345
|
+
throw createClientConfigurationError(invalidDpopHtm, correlationId);
|
|
6346
|
+
}
|
|
6347
|
+
return htm.toUpperCase();
|
|
6348
|
+
}
|
|
6349
|
+
/**
|
|
6350
|
+
* Normalizes a URL for use as the DPoP htu claim.
|
|
6351
|
+
* Per RFC 9449 §4.2, htu is the target URI without query and fragment components.
|
|
6352
|
+
* WHATWG URL serialization handles RFC 3986 syntax- and scheme-based normalization
|
|
6353
|
+
* such as lowercasing scheme/host and eliding default ports.
|
|
6354
|
+
*/
|
|
6355
|
+
function normalizeHtu(url, correlationId) {
|
|
6356
|
+
let parsedUrl;
|
|
6357
|
+
try {
|
|
6358
|
+
parsedUrl = new URL(url);
|
|
6359
|
+
}
|
|
6360
|
+
catch {
|
|
6361
|
+
throw createClientConfigurationError(urlParseError, correlationId);
|
|
6362
|
+
}
|
|
6363
|
+
if (!/^https:\/\//i.test(url) ||
|
|
6364
|
+
parsedUrl.protocol !== "https:" ||
|
|
6365
|
+
parsedUrl.username ||
|
|
6366
|
+
parsedUrl.password) {
|
|
6367
|
+
throw createClientConfigurationError(invalidDpopHtu, correlationId);
|
|
6368
|
+
}
|
|
6369
|
+
parsedUrl.search = "";
|
|
6370
|
+
parsedUrl.hash = "";
|
|
6371
|
+
return parsedUrl.href;
|
|
6372
|
+
}
|
|
6373
|
+
function validateDpopNonce(nonce, correlationId) {
|
|
6374
|
+
if (nonce !== undefined && nonce.trim().length === 0) {
|
|
6375
|
+
throw createClientConfigurationError(invalidDpopNonce, correlationId);
|
|
6376
|
+
}
|
|
6377
|
+
}
|
|
6378
|
+
/**
|
|
6379
|
+
* Builds RFC 9449 DPoP proof JWT payloads for token-endpoint and
|
|
6380
|
+
* resource-endpoint proof bindings.
|
|
6381
|
+
*
|
|
6382
|
+
* Not exported from any public package entry point.
|
|
6383
|
+
* This helper is internal-only until DPoP is wired into acquisition flows
|
|
6384
|
+
* in a subsequent work item.
|
|
6385
|
+
*
|
|
6386
|
+
* DPoP proofs do not contain SHR fields (at, ts, m, u, p, q).
|
|
6387
|
+
* @internal
|
|
6388
|
+
*/
|
|
6389
|
+
class DpopProofGenerator {
|
|
6390
|
+
constructor(cryptoUtils, tokenBindingKeyManager) {
|
|
6391
|
+
this.cryptoUtils = cryptoUtils;
|
|
6392
|
+
this.tokenBindingKeyManager = tokenBindingKeyManager;
|
|
6393
|
+
}
|
|
6394
|
+
/**
|
|
6395
|
+
* Provisions a fresh DPoP key and returns the RFC 7638 JWK thumbprint used
|
|
6396
|
+
* as `dpop_jkt`.
|
|
6397
|
+
*/
|
|
6398
|
+
async generateJkt(correlationId = "") {
|
|
6399
|
+
return this.tokenBindingKeyManager.provisionTokenBindingKey({
|
|
6400
|
+
tokenBindingKeyType: DPOP_TOKEN_BINDING_KEY_TYPE,
|
|
6401
|
+
tokenBindingKeyAlgorithm: DPOP_JWT_HEADER_ALGORITHM,
|
|
6402
|
+
correlationId,
|
|
6403
|
+
});
|
|
6404
|
+
}
|
|
6405
|
+
/**
|
|
6406
|
+
* Builds RFC 9449 claims for a token-endpoint DPoP proof.
|
|
6407
|
+
* - htm is always "POST" because token endpoint requests use HTTP POST (RFC 9449 §5).
|
|
6408
|
+
* - htu is the normalized token endpoint URI (query and fragment stripped).
|
|
6409
|
+
* - jti is a fresh CSPRNG-backed unique identifier for every proof.
|
|
6410
|
+
*/
|
|
6411
|
+
buildTokenProofClaims(params, correlationId = "") {
|
|
6412
|
+
validateDpopNonce(params.nonce, correlationId);
|
|
6413
|
+
const claims = {
|
|
6414
|
+
jti: this.cryptoUtils.createNewGuid(),
|
|
6415
|
+
htm: "POST",
|
|
6416
|
+
htu: normalizeHtu(params.tokenEndpoint, correlationId),
|
|
6417
|
+
iat: nowSeconds(),
|
|
6418
|
+
};
|
|
6419
|
+
if (params.nonce !== undefined) {
|
|
6420
|
+
claims.nonce = params.nonce;
|
|
6421
|
+
}
|
|
6422
|
+
return claims;
|
|
6423
|
+
}
|
|
6424
|
+
/**
|
|
6425
|
+
* Builds and signs a compact DPoP proof JWT for a token-endpoint request.
|
|
6426
|
+
*/
|
|
6427
|
+
async generateTokenProof(params, keyId, correlationId = "") {
|
|
6428
|
+
return this.generateProof(this.buildTokenProofClaims(params, correlationId), keyId, correlationId);
|
|
6429
|
+
}
|
|
6430
|
+
/**
|
|
6431
|
+
* Builds RFC 9449 claims for a resource-endpoint DPoP proof.
|
|
6432
|
+
* - htm is uppercased per RFC 9449 §4.2.
|
|
6433
|
+
* - htu is the normalized resource URI (query and fragment stripped).
|
|
6434
|
+
* - ath is the base64url-encoded SHA-256 hash of the ASCII access token.
|
|
6435
|
+
* - jti is a fresh CSPRNG-backed unique identifier for every proof.
|
|
6436
|
+
*/
|
|
6437
|
+
buildResourceProofClaims(params, correlationId = "") {
|
|
6438
|
+
validateDpopNonce(params.nonce, correlationId);
|
|
6439
|
+
const claims = {
|
|
6440
|
+
jti: this.cryptoUtils.createNewGuid(),
|
|
6441
|
+
htm: normalizeHtm(params.htm, correlationId),
|
|
6442
|
+
htu: normalizeHtu(params.htu, correlationId),
|
|
6443
|
+
ath: params.ath,
|
|
6444
|
+
iat: nowSeconds(),
|
|
6445
|
+
};
|
|
6446
|
+
if (params.nonce !== undefined) {
|
|
6447
|
+
claims.nonce = params.nonce;
|
|
6448
|
+
}
|
|
6449
|
+
return claims;
|
|
6450
|
+
}
|
|
6451
|
+
/**
|
|
6452
|
+
* Builds and signs a compact DPoP proof JWT for a resource request.
|
|
6453
|
+
*/
|
|
6454
|
+
async generateResourceProof(params, keyId, correlationId = "") {
|
|
6455
|
+
const { htu, htm, nonce } = params;
|
|
6456
|
+
if (!htu || !htm) {
|
|
6457
|
+
throw createClientConfigurationError(dpopMissingResourceContext, correlationId);
|
|
6458
|
+
}
|
|
6459
|
+
const ath = await this.cryptoUtils.hashString(params.accessToken);
|
|
6460
|
+
return this.generateProof(this.buildResourceProofClaims({
|
|
6461
|
+
htu,
|
|
6462
|
+
htm,
|
|
6463
|
+
ath,
|
|
6464
|
+
nonce,
|
|
6465
|
+
}, correlationId), keyId, correlationId);
|
|
6466
|
+
}
|
|
6467
|
+
async generateProof(claims, keyId, correlationId) {
|
|
6468
|
+
const publicJwk = await this.tokenBindingKeyManager.getTokenBindingPublicKeyJwk(keyId, correlationId);
|
|
6469
|
+
return this.cryptoUtils.signTokenBindingJwt(buildProofHeader(publicJwk, correlationId), claims, keyId, correlationId);
|
|
6470
|
+
}
|
|
6471
|
+
}
|
|
6472
|
+
|
|
6325
6473
|
/*
|
|
6326
6474
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6327
6475
|
* Licensed under the MIT License.
|
|
@@ -6630,7 +6778,21 @@ class ResponseHandler {
|
|
|
6630
6778
|
}
|
|
6631
6779
|
// Add keyId from request to serverTokenResponse if defined
|
|
6632
6780
|
serverTokenResponse.key_id =
|
|
6633
|
-
serverTokenResponse.key_id ||
|
|
6781
|
+
serverTokenResponse.key_id ||
|
|
6782
|
+
request.dpopJkt ||
|
|
6783
|
+
request.sshKid ||
|
|
6784
|
+
undefined;
|
|
6785
|
+
if (request.authenticationScheme === AuthenticationScheme.DPOP) {
|
|
6786
|
+
if (serverTokenResponse.token_type?.toLowerCase() !==
|
|
6787
|
+
AuthenticationScheme.DPOP.toLowerCase()) {
|
|
6788
|
+
this.performanceClient?.addFields({
|
|
6789
|
+
dpopTokenTypeMismatch: serverTokenResponse.token_type,
|
|
6790
|
+
}, request.correlationId);
|
|
6791
|
+
throw createClientAuthError(dpopTokenTypeMismatch, request.correlationId);
|
|
6792
|
+
}
|
|
6793
|
+
serverTokenResponse.token_type =
|
|
6794
|
+
AuthenticationScheme.DPOP;
|
|
6795
|
+
}
|
|
6634
6796
|
// Compute components once for entity storage (fallback if hash not provided by client)
|
|
6635
6797
|
const attributeTokenPartition = serializeAttributeTokens(request.attributeTokens);
|
|
6636
6798
|
const cacheKeyComponents = additionalCacheKeyComponents ??
|
|
@@ -6793,7 +6955,9 @@ class ResponseHandler {
|
|
|
6793
6955
|
let extExpiresOn;
|
|
6794
6956
|
let refreshOn;
|
|
6795
6957
|
let familyId = "";
|
|
6958
|
+
let dpopProof;
|
|
6796
6959
|
if (cacheRecord.accessToken) {
|
|
6960
|
+
const accessTokenType = cacheRecord.accessToken.tokenType?.toLowerCase();
|
|
6797
6961
|
/*
|
|
6798
6962
|
* if the request object has `popKid` property, `signPopToken` will be set to false and
|
|
6799
6963
|
* the token will be returned unsigned
|
|
@@ -6811,6 +6975,18 @@ class ResponseHandler {
|
|
|
6811
6975
|
else {
|
|
6812
6976
|
accessToken = cacheRecord.accessToken.secret;
|
|
6813
6977
|
}
|
|
6978
|
+
if (accessTokenType ===
|
|
6979
|
+
AuthenticationScheme.DPOP.toLowerCase()) {
|
|
6980
|
+
if (!cacheRecord.accessToken.keyId) {
|
|
6981
|
+
throw createClientAuthError(keyIdMissing, request.correlationId);
|
|
6982
|
+
}
|
|
6983
|
+
const dpopProofGenerator = new DpopProofGenerator(cryptoObj, tokenBindingKeyManager);
|
|
6984
|
+
dpopProof = await dpopProofGenerator.generateResourceProof({
|
|
6985
|
+
htu: request.resourceRequestUri,
|
|
6986
|
+
htm: request.resourceRequestMethod,
|
|
6987
|
+
accessToken: cacheRecord.accessToken.secret,
|
|
6988
|
+
}, cacheRecord.accessToken.keyId, request.correlationId);
|
|
6989
|
+
}
|
|
6814
6990
|
responseScopes = ScopeSet.fromString(cacheRecord.accessToken.target, request.correlationId).asArray();
|
|
6815
6991
|
// Access token expiresOn cached in seconds, converting to Date for AuthenticationResult
|
|
6816
6992
|
expiresOn = toDateFromSeconds(cacheRecord.accessToken.expiresOn);
|
|
@@ -6827,6 +7003,15 @@ class ResponseHandler {
|
|
|
6827
7003
|
}
|
|
6828
7004
|
const uid = idTokenClaims?.oid || idTokenClaims?.sub || "";
|
|
6829
7005
|
const tid = idTokenClaims?.tid || "";
|
|
7006
|
+
/*
|
|
7007
|
+
* Surface the sovereign enclave for telemetry. This runs for both freshly acquired
|
|
7008
|
+
* and cache-served tokens because SilentFlowClient shares this method, so the field
|
|
7009
|
+
* is present on silent requests that never hit the network.
|
|
7010
|
+
*/
|
|
7011
|
+
const regionSubScope = idTokenClaims?.tenant_region_sub_scope;
|
|
7012
|
+
if (typeof regionSubScope === "string") {
|
|
7013
|
+
performanceClient?.addFields({ regionSubScope }, request.correlationId);
|
|
7014
|
+
}
|
|
6830
7015
|
// for hybrid + native bridge enablement, send back the native account Id
|
|
6831
7016
|
if (serverTokenResponse?.spa_accountid && !!cacheRecord.account) {
|
|
6832
7017
|
// Set on deprecated top-level for downgrade compat
|
|
@@ -6855,6 +7040,7 @@ class ResponseHandler {
|
|
|
6855
7040
|
idToken: cacheRecord?.idToken?.secret || "",
|
|
6856
7041
|
idTokenClaims: idTokenClaims || {},
|
|
6857
7042
|
accessToken: accessToken,
|
|
7043
|
+
dpopProof,
|
|
6858
7044
|
fromCache: fromTokenCache,
|
|
6859
7045
|
expiresOn: expiresOn,
|
|
6860
7046
|
extExpiresOn: extExpiresOn,
|
|
@@ -6862,7 +7048,10 @@ class ResponseHandler {
|
|
|
6862
7048
|
correlationId: request.correlationId,
|
|
6863
7049
|
requestId: requestId || "",
|
|
6864
7050
|
familyId: familyId,
|
|
6865
|
-
tokenType: cacheRecord.accessToken?.tokenType
|
|
7051
|
+
tokenType: cacheRecord.accessToken?.tokenType?.toLowerCase() ===
|
|
7052
|
+
AuthenticationScheme.DPOP.toLowerCase()
|
|
7053
|
+
? AuthenticationScheme.DPOP
|
|
7054
|
+
: cacheRecord.accessToken?.tokenType || "",
|
|
6866
7055
|
state: requestState ? requestState.userRequestState : "",
|
|
6867
7056
|
cloudGraphHostName: cacheRecord.account?.cloudGraphHostName || "",
|
|
6868
7057
|
msGraphHost: cacheRecord.account?.msGraphHost || "",
|
|
@@ -7108,6 +7297,23 @@ function createTokenRequestHeaders(logger, preventCorsPreflight, ccsCred) {
|
|
|
7108
7297
|
}
|
|
7109
7298
|
return headers;
|
|
7110
7299
|
}
|
|
7300
|
+
/**
|
|
7301
|
+
* Adds the DPoP proof header for token endpoint requests when DPoP is requested.
|
|
7302
|
+
* @internal
|
|
7303
|
+
*/
|
|
7304
|
+
async function addDpopTokenProofHeader(headers, request, tokenEndpoint, cryptoUtils, tokenBindingKeyManager) {
|
|
7305
|
+
if (request.authenticationScheme !== AuthenticationScheme.DPOP) {
|
|
7306
|
+
return;
|
|
7307
|
+
}
|
|
7308
|
+
const dpopProofGenerator = new DpopProofGenerator(cryptoUtils, tokenBindingKeyManager);
|
|
7309
|
+
const keyId = request.dpopJkt;
|
|
7310
|
+
if (!keyId?.trim()) {
|
|
7311
|
+
throw createClientAuthError(keyIdMissing, request.correlationId);
|
|
7312
|
+
}
|
|
7313
|
+
headers[HeaderNames.DPOP] = await dpopProofGenerator.generateTokenProof({
|
|
7314
|
+
tokenEndpoint,
|
|
7315
|
+
}, keyId, request.correlationId);
|
|
7316
|
+
}
|
|
7111
7317
|
/**
|
|
7112
7318
|
* Creates query string for the /token request
|
|
7113
7319
|
* @param request
|
|
@@ -7196,6 +7402,7 @@ async function sendPostRequest(thumbprint, tokenEndpoint, options, correlationId
|
|
|
7196
7402
|
|
|
7197
7403
|
var Token = /*#__PURE__*/Object.freeze({
|
|
7198
7404
|
__proto__: null,
|
|
7405
|
+
addDpopTokenProofHeader: addDpopTokenProofHeader,
|
|
7199
7406
|
createTokenQueryParameters: createTokenQueryParameters,
|
|
7200
7407
|
createTokenRequestHeaders: createTokenRequestHeaders,
|
|
7201
7408
|
executePostToTokenEndpoint: executePostToTokenEndpoint,
|
|
@@ -7292,6 +7499,7 @@ class AuthorizationCodeClient {
|
|
|
7292
7499
|
}
|
|
7293
7500
|
}
|
|
7294
7501
|
const headers = createTokenRequestHeaders(this.logger, this.config.systemOptions.preventCorsPreflight, ccsCredential || request.ccsCredential);
|
|
7502
|
+
await addDpopTokenProofHeader(headers, request, endpoint, this.cryptoUtils, this.config.tokenBindingKeyManager);
|
|
7295
7503
|
const thumbprint = getRequestThumbprint(this.config.authOptions.clientId, request);
|
|
7296
7504
|
return invokeAsync(executePostToTokenEndpoint, AuthorizationCodeClientExecutePostToTokenEndpoint, this.logger, this.performanceClient, request.correlationId)(endpoint, requestBody, headers, thumbprint, request.correlationId, this.cacheManager, this.networkClient, this.logger, this.performanceClient, serverTelemetryManager);
|
|
7297
7505
|
}
|
|
@@ -7572,6 +7780,12 @@ class RefreshTokenClient {
|
|
|
7572
7780
|
type: CcsCredentialType.HOME_ACCOUNT_ID,
|
|
7573
7781
|
},
|
|
7574
7782
|
};
|
|
7783
|
+
if (refreshTokenRequest.authenticationScheme ===
|
|
7784
|
+
AuthenticationScheme.DPOP &&
|
|
7785
|
+
!refreshTokenRequest.dpopJkt) {
|
|
7786
|
+
const dpopProofGenerator = new DpopProofGenerator(this.cryptoUtils, this.config.tokenBindingKeyManager);
|
|
7787
|
+
refreshTokenRequest.dpopJkt = await dpopProofGenerator.generateJkt(request.correlationId);
|
|
7788
|
+
}
|
|
7575
7789
|
try {
|
|
7576
7790
|
return await invokeAsync(this.acquireToken.bind(this), RefreshTokenClientAcquireToken, this.logger, this.performanceClient, request.correlationId)(refreshTokenRequest, apiId);
|
|
7577
7791
|
}
|
|
@@ -7597,6 +7811,7 @@ class RefreshTokenClient {
|
|
|
7597
7811
|
const endpoint = UrlString.appendQueryString(authority.tokenEndpoint, queryParametersString);
|
|
7598
7812
|
const requestBody = await invokeAsync(this.createTokenRequestBody.bind(this), RefreshTokenClientCreateTokenRequestBody, this.logger, this.performanceClient, request.correlationId)(request);
|
|
7599
7813
|
const headers = createTokenRequestHeaders(this.logger, this.config.systemOptions.preventCorsPreflight, request.ccsCredential);
|
|
7814
|
+
await addDpopTokenProofHeader(headers, request, endpoint, this.cryptoUtils, this.config.tokenBindingKeyManager);
|
|
7600
7815
|
const thumbprint = getRequestThumbprint(this.config.authOptions.clientId, request);
|
|
7601
7816
|
return invokeAsync(executePostToTokenEndpoint, RefreshTokenClientExecutePostToTokenEndpoint, this.logger, this.performanceClient, request.correlationId)(endpoint, requestBody, headers, thumbprint, request.correlationId, this.cacheManager, this.networkClient, this.logger, this.performanceClient, this.serverTelemetryManager);
|
|
7602
7817
|
}
|
|
@@ -7755,6 +7970,22 @@ class SilentFlowClient {
|
|
|
7755
7970
|
lastCacheOutcome = CacheOutcome.PROACTIVELY_REFRESHED;
|
|
7756
7971
|
// don't throw ClientAuthError.createRefreshRequiredError(), return cached token instead
|
|
7757
7972
|
}
|
|
7973
|
+
const cachedAccessTokenType = cachedAccessToken.tokenType?.toLowerCase();
|
|
7974
|
+
if (cachedAccessTokenType === AuthenticationScheme.DPOP.toLowerCase()) {
|
|
7975
|
+
if (!cachedAccessToken.keyId) {
|
|
7976
|
+
this.logger.info("SilentFlowClient:acquireCachedToken - Cached DPoP access token is missing keyId; refresh required", request.correlationId);
|
|
7977
|
+
this.setCacheOutcome(CacheOutcome.NO_CACHED_ACCESS_TOKEN, request.correlationId);
|
|
7978
|
+
throw createClientAuthError(tokenRefreshRequired, request.correlationId);
|
|
7979
|
+
}
|
|
7980
|
+
try {
|
|
7981
|
+
await this.config.tokenBindingKeyManager.getTokenBindingPublicKeyJwk(cachedAccessToken.keyId, request.correlationId);
|
|
7982
|
+
}
|
|
7983
|
+
catch {
|
|
7984
|
+
this.logger.info("SilentFlowClient:acquireCachedToken - Local DPoP key was not found for cached access token; refresh required", request.correlationId);
|
|
7985
|
+
this.setCacheOutcome(CacheOutcome.NO_CACHED_ACCESS_TOKEN, request.correlationId);
|
|
7986
|
+
throw createClientAuthError(tokenRefreshRequired, request.correlationId);
|
|
7987
|
+
}
|
|
7988
|
+
}
|
|
7758
7989
|
const environment = request.authority || this.authority.getPreferredCache();
|
|
7759
7990
|
const cacheRecord = {
|
|
7760
7991
|
account: this.cacheManager.getAccount(this.cacheManager.generateAccountKey(request.account), request.correlationId),
|
|
@@ -8546,4 +8777,4 @@ exports.invokeAsync = invokeAsync;
|
|
|
8546
8777
|
exports.tenantIdMatchesHomeTenant = tenantIdMatchesHomeTenant;
|
|
8547
8778
|
exports.updateAccountTenantProfileData = updateAccountTenantProfileData;
|
|
8548
8779
|
exports.version = version;
|
|
8549
|
-
//# sourceMappingURL=index-node-
|
|
8780
|
+
//# sourceMappingURL=index-node-l_NIe8t5.js.map
|