@azure/msal-common 16.14.3 → 16.15.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 +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 +1 -1
- package/dist/cache/persistence/TokenCacheContext.mjs +1 -1
- package/dist/cache/utils/AccountEntityUtils.mjs +1 -1
- package/dist/cache/utils/CacheHelpers.mjs +1 -1
- package/dist/client/AuthorizationCodeClient.mjs +5 -2
- package/dist/client/AuthorizationCodeClient.mjs.map +1 -1
- package/dist/client/RefreshTokenClient.mjs +1 -1
- package/dist/client/SilentFlowClient.mjs +1 -1
- package/dist/config/ClientConfiguration.mjs +1 -1
- package/dist/constants/AADServerParamKeys.mjs +9 -3
- package/dist/constants/AADServerParamKeys.mjs.map +1 -1
- package/dist/crypto/DpopProofGenerator.mjs +1 -1
- package/dist/crypto/ICrypto.mjs +1 -1
- package/dist/crypto/ITokenBindingKeyManager.mjs +1 -1
- package/dist/crypto/JoseHeader.mjs +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 +1 -1
- package/dist/error/ClientConfigurationError.mjs +1 -1
- package/dist/error/ClientConfigurationErrorCodes.mjs +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/ResponseHeaders.mjs +43 -0
- package/dist/network/ResponseHeaders.mjs.map +1 -0
- package/dist/network/ThrottlingUtils.mjs +16 -11
- package/dist/network/ThrottlingUtils.mjs.map +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/protocol/Authorize.mjs +5 -2
- package/dist/protocol/Authorize.mjs.map +1 -1
- package/dist/protocol/Token.mjs +9 -7
- package/dist/protocol/Token.mjs.map +1 -1
- package/dist/request/AuthenticationHeaderParser.mjs +6 -4
- package/dist/request/AuthenticationHeaderParser.mjs.map +1 -1
- package/dist/request/BaseAuthRequest.mjs +1 -1
- package/dist/request/RequestParameterBuilder.mjs +17 -3
- package/dist/request/RequestParameterBuilder.mjs.map +1 -1
- package/dist/request/ScopeSet.mjs +1 -1
- package/dist/response/ResponseHandler.mjs +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 +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 +12 -3
- package/dist/utils/UrlUtils.mjs.map +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 +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 +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 +1 -1
- package/dist-browser/client/AuthorizationCodeClient.mjs +5 -2
- package/dist-browser/client/AuthorizationCodeClient.mjs.map +1 -1
- package/dist-browser/client/RefreshTokenClient.mjs +1 -1
- package/dist-browser/client/SilentFlowClient.mjs +1 -1
- package/dist-browser/config/ClientConfiguration.mjs +1 -1
- package/dist-browser/constants/AADServerParamKeys.mjs +9 -3
- package/dist-browser/constants/AADServerParamKeys.mjs.map +1 -1
- package/dist-browser/crypto/DpopProofGenerator.mjs +1 -1
- package/dist-browser/crypto/ICrypto.mjs +1 -1
- package/dist-browser/crypto/ITokenBindingKeyManager.mjs +1 -1
- package/dist-browser/crypto/JoseHeader.mjs +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 +1 -1
- package/dist-browser/error/ClientConfigurationError.mjs +1 -1
- package/dist-browser/error/ClientConfigurationErrorCodes.mjs +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 +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/ResponseHeaders.mjs +43 -0
- package/dist-browser/network/ResponseHeaders.mjs.map +1 -0
- package/dist-browser/network/ThrottlingUtils.mjs +16 -11
- package/dist-browser/network/ThrottlingUtils.mjs.map +1 -1
- package/dist-browser/packageMetadata.mjs +2 -2
- package/dist-browser/protocol/Authorize.mjs +5 -2
- package/dist-browser/protocol/Authorize.mjs.map +1 -1
- package/dist-browser/protocol/Token.mjs +9 -7
- package/dist-browser/protocol/Token.mjs.map +1 -1
- package/dist-browser/request/AuthenticationHeaderParser.mjs +6 -4
- package/dist-browser/request/AuthenticationHeaderParser.mjs.map +1 -1
- package/dist-browser/request/BaseAuthRequest.mjs +1 -1
- package/dist-browser/request/RequestParameterBuilder.mjs +17 -3
- package/dist-browser/request/RequestParameterBuilder.mjs.map +1 -1
- package/dist-browser/request/ScopeSet.mjs +1 -1
- package/dist-browser/response/ResponseHandler.mjs +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 +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 +12 -3
- package/dist-browser/utils/UrlUtils.mjs.map +1 -1
- package/lib/index-browser.cjs +2 -2
- package/lib/{index-node-cgWrVUUm.js → index-node-DD4RzKVr.js} +106 -24
- package/lib/index-node-DD4RzKVr.js.map +1 -0
- package/lib/index-node.cjs +2 -2
- package/lib/index.cjs +2 -2
- package/package.json +1 -1
- package/src/client/AuthorizationCodeClient.ts +4 -0
- package/src/constants/AADServerParamKeys.ts +6 -0
- package/src/network/NetworkResponse.ts +3 -0
- package/src/network/ResponseHeaders.ts +52 -0
- package/src/network/ThrottlingUtils.ts +20 -15
- package/src/packageMetadata.ts +1 -1
- package/src/protocol/Authorize.ts +4 -0
- package/src/protocol/Token.ts +19 -6
- package/src/request/AuthenticationHeaderParser.ts +14 -3
- package/src/request/CommonAuthorizationUrlRequest.ts +8 -0
- package/src/request/CommonEndSessionRequest.ts +8 -0
- package/src/request/RequestParameterBuilder.ts +15 -0
- package/src/telemetry/performance/PerformanceEvent.ts +12 -0
- package/src/utils/UrlUtils.ts +12 -2
- package/types/client/AuthorizationCodeClient.d.ts.map +1 -1
- package/types/constants/AADServerParamKeys.d.ts +6 -0
- package/types/constants/AADServerParamKeys.d.ts.map +1 -1
- package/types/network/NetworkResponse.d.ts +3 -0
- package/types/network/NetworkResponse.d.ts.map +1 -1
- package/types/network/ResponseHeaders.d.ts +13 -0
- package/types/network/ResponseHeaders.d.ts.map +1 -0
- package/types/network/ThrottlingUtils.d.ts +2 -2
- package/types/network/ThrottlingUtils.d.ts.map +1 -1
- package/types/packageMetadata.d.ts +1 -1
- package/types/protocol/Authorize.d.ts.map +1 -1
- package/types/protocol/Token.d.ts.map +1 -1
- package/types/request/AuthenticationHeaderParser.d.ts +1 -0
- package/types/request/AuthenticationHeaderParser.d.ts.map +1 -1
- package/types/request/CommonAuthorizationUrlRequest.d.ts +8 -0
- package/types/request/CommonAuthorizationUrlRequest.d.ts.map +1 -1
- package/types/request/CommonEndSessionRequest.d.ts +8 -0
- package/types/request/CommonEndSessionRequest.d.ts.map +1 -1
- package/types/request/RequestParameterBuilder.d.ts +10 -0
- package/types/request/RequestParameterBuilder.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/UrlUtils.d.ts +2 -1
- package/types/utils/UrlUtils.d.ts.map +1 -1
- package/lib/index-node-cgWrVUUm.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-common v16.
|
|
1
|
+
/*! @azure/msal-common v16.15.0 2026-10-27 */
|
|
2
2
|
'use strict';
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
@@ -2895,7 +2895,8 @@ function stripLeadingHashOrQuery(responseString) {
|
|
|
2895
2895
|
return responseString;
|
|
2896
2896
|
}
|
|
2897
2897
|
/**
|
|
2898
|
-
* Returns
|
|
2898
|
+
* Returns flat fragment or query parameters as an authorization response.
|
|
2899
|
+
* Application routes and unrecognized responses return null.
|
|
2899
2900
|
*/
|
|
2900
2901
|
function getDeserializedResponse(responseString) {
|
|
2901
2902
|
// Check if given hash is empty
|
|
@@ -2905,7 +2906,15 @@ function getDeserializedResponse(responseString) {
|
|
|
2905
2906
|
try {
|
|
2906
2907
|
// Strip the # or ? symbol if present
|
|
2907
2908
|
const normalizedResponse = stripLeadingHashOrQuery(responseString);
|
|
2908
|
-
|
|
2909
|
+
/*
|
|
2910
|
+
* Require a flat parameter name, not an application route.
|
|
2911
|
+
* Reject routes like #/dashboard?tab=orders&code=... and
|
|
2912
|
+
* #/dashboard/orders&state=..., where ?, /, or # appears before
|
|
2913
|
+
* the first = or &. These characters are allowed in parameter values.
|
|
2914
|
+
*/
|
|
2915
|
+
if (!/^[^=&?#/]+(?:=|&|$)/.test(normalizedResponse)) {
|
|
2916
|
+
return null;
|
|
2917
|
+
}
|
|
2909
2918
|
const deserializedHash = Object.fromEntries(new URLSearchParams(normalizedResponse));
|
|
2910
2919
|
// Check for known response properties
|
|
2911
2920
|
if (deserializedHash.code ||
|
|
@@ -3074,7 +3083,13 @@ const USER_FEDERATED_IDENTITY_CREDENTIAL = "user_federated_identity_credential";
|
|
|
3074
3083
|
const USERNAME = "username";
|
|
3075
3084
|
const USER_ID = "user_id";
|
|
3076
3085
|
const FMI_PATH = "fmi_path";
|
|
3077
|
-
const ATTRIBUTE_TOKENS = "attribute_tokens";
|
|
3086
|
+
const ATTRIBUTE_TOKENS = "attribute_tokens";
|
|
3087
|
+
/**
|
|
3088
|
+
* Popup-origin-check-done. Signals to the STS that the client verified the
|
|
3089
|
+
* popup cannot be reached by an untrusted window, so the
|
|
3090
|
+
* Cross-Origin-Opener-Policy response header may be omitted.
|
|
3091
|
+
*/
|
|
3092
|
+
const POPUP_ORIGIN_CHECK_DONE = "pocd";
|
|
3078
3093
|
|
|
3079
3094
|
var AADServerParamKeys = /*#__PURE__*/Object.freeze({
|
|
3080
3095
|
__proto__: null,
|
|
@@ -3115,6 +3130,7 @@ var AADServerParamKeys = /*#__PURE__*/Object.freeze({
|
|
|
3115
3130
|
NONCE: NONCE,
|
|
3116
3131
|
OBO_ASSERTION: OBO_ASSERTION,
|
|
3117
3132
|
ON_BEHALF_OF: ON_BEHALF_OF,
|
|
3133
|
+
POPUP_ORIGIN_CHECK_DONE: POPUP_ORIGIN_CHECK_DONE,
|
|
3118
3134
|
POST_LOGOUT_URI: POST_LOGOUT_URI,
|
|
3119
3135
|
PROMPT: PROMPT,
|
|
3120
3136
|
REDIRECT_URI: REDIRECT_URI,
|
|
@@ -4004,6 +4020,20 @@ function addInstanceAware(parameters) {
|
|
|
4004
4020
|
parameters.set(INSTANCE_AWARE, "true");
|
|
4005
4021
|
}
|
|
4006
4022
|
}
|
|
4023
|
+
/**
|
|
4024
|
+
* Adds `pocd=1`, telling the STS that the client verified the popup driving
|
|
4025
|
+
* this request cannot be reached by an untrusted window, so the
|
|
4026
|
+
* Cross-Origin-Opener-Policy response header may be omitted.
|
|
4027
|
+
*
|
|
4028
|
+
* Only ever added when the check passed — a negative result is signalled by
|
|
4029
|
+
* omitting the parameter, which keeps the STS default (apply COOP) and stays
|
|
4030
|
+
* compatible with library versions that never send it.
|
|
4031
|
+
*/
|
|
4032
|
+
function addPopupOriginCheckDone(parameters) {
|
|
4033
|
+
if (!parameters.has(POPUP_ORIGIN_CHECK_DONE)) {
|
|
4034
|
+
parameters.set(POPUP_ORIGIN_CHECK_DONE, "1");
|
|
4035
|
+
}
|
|
4036
|
+
}
|
|
4007
4037
|
/**
|
|
4008
4038
|
* Add extraParameters
|
|
4009
4039
|
* @param extraParams - String dictionary containing extra parameters to be added.
|
|
@@ -4256,6 +4286,7 @@ var RequestParameterBuilder = /*#__PURE__*/Object.freeze({
|
|
|
4256
4286
|
addOboAssertion: addOboAssertion,
|
|
4257
4287
|
addPassword: addPassword,
|
|
4258
4288
|
addPopToken: addPopToken,
|
|
4289
|
+
addPopupOriginCheckDone: addPopupOriginCheckDone,
|
|
4259
4290
|
addPostLogoutRedirectUri: addPostLogoutRedirectUri,
|
|
4260
4291
|
addPrompt: addPrompt,
|
|
4261
4292
|
addRedirectUri: addRedirectUri,
|
|
@@ -4632,7 +4663,7 @@ class Logger {
|
|
|
4632
4663
|
|
|
4633
4664
|
/* eslint-disable header/header */
|
|
4634
4665
|
const name = "@azure/msal-common";
|
|
4635
|
-
const version = "16.
|
|
4666
|
+
const version = "16.15.0";
|
|
4636
4667
|
|
|
4637
4668
|
/*
|
|
4638
4669
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7171,6 +7202,45 @@ function getRequestThumbprint(clientId, request, homeAccountId) {
|
|
|
7171
7202
|
};
|
|
7172
7203
|
}
|
|
7173
7204
|
|
|
7205
|
+
/*
|
|
7206
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
7207
|
+
* Licensed under the MIT License.
|
|
7208
|
+
*/
|
|
7209
|
+
// Track only our normalized copies, never caller-owned mutable inputs.
|
|
7210
|
+
const normalizedHeaderRecords = new WeakSet();
|
|
7211
|
+
/**
|
|
7212
|
+
* Creates a lowercase-keyed snapshot without changing header values or the input.
|
|
7213
|
+
* Reuses snapshots produced by this function to avoid repeated normalization.
|
|
7214
|
+
* @internal
|
|
7215
|
+
*/
|
|
7216
|
+
function normalizeResponseHeaders(headers) {
|
|
7217
|
+
if (normalizedHeaderRecords.has(headers)) {
|
|
7218
|
+
return headers;
|
|
7219
|
+
}
|
|
7220
|
+
const normalized = Object.fromEntries(Object.entries(headers).map(([name, value]) => [
|
|
7221
|
+
name.toLowerCase(),
|
|
7222
|
+
value,
|
|
7223
|
+
]));
|
|
7224
|
+
normalizedHeaderRecords.add(normalized);
|
|
7225
|
+
return normalized;
|
|
7226
|
+
}
|
|
7227
|
+
/**
|
|
7228
|
+
* Reads a response header case-insensitively.
|
|
7229
|
+
* Normalized snapshots are never scanned, even when a header is missing.
|
|
7230
|
+
* @internal
|
|
7231
|
+
*/
|
|
7232
|
+
function getResponseHeader(headers, name) {
|
|
7233
|
+
const key = name.toLowerCase();
|
|
7234
|
+
if (Object.prototype.hasOwnProperty.call(headers, key)) {
|
|
7235
|
+
return headers[key];
|
|
7236
|
+
}
|
|
7237
|
+
if (normalizedHeaderRecords.has(headers)) {
|
|
7238
|
+
return undefined;
|
|
7239
|
+
}
|
|
7240
|
+
const headerName = Object.keys(headers).find((header) => header.toLowerCase() === key);
|
|
7241
|
+
return headerName === undefined ? undefined : headers[headerName];
|
|
7242
|
+
}
|
|
7243
|
+
|
|
7174
7244
|
/*
|
|
7175
7245
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
7176
7246
|
* Licensed under the MIT License.
|
|
@@ -7204,13 +7274,14 @@ class ThrottlingUtils {
|
|
|
7204
7274
|
* Performs necessary throttling checks after a network request.
|
|
7205
7275
|
* @param cacheManager
|
|
7206
7276
|
* @param thumbprint
|
|
7207
|
-
* @param response
|
|
7277
|
+
* @param response - Token response with case-insensitive header names.
|
|
7208
7278
|
*/
|
|
7209
7279
|
static postProcess(cacheManager, thumbprint, response, correlationId) {
|
|
7280
|
+
const retryAfter = getRetryAfterHeader(response);
|
|
7210
7281
|
if (ThrottlingUtils.checkResponseStatus(response) ||
|
|
7211
|
-
|
|
7282
|
+
retryAfter !== undefined) {
|
|
7212
7283
|
const thumbprintValue = {
|
|
7213
|
-
throttleTime: ThrottlingUtils.calculateThrottleTime(parseInt(
|
|
7284
|
+
throttleTime: ThrottlingUtils.calculateThrottleTime(parseInt(retryAfter || "")),
|
|
7214
7285
|
error: response.body.error,
|
|
7215
7286
|
errorCodes: response.body.error_codes,
|
|
7216
7287
|
errorMessage: response.body.error_description,
|
|
@@ -7229,14 +7300,10 @@ class ThrottlingUtils {
|
|
|
7229
7300
|
}
|
|
7230
7301
|
/**
|
|
7231
7302
|
* Checks a NetworkResponse object's RetryAfter header
|
|
7232
|
-
* @param response
|
|
7303
|
+
* @param response - Token response with case-insensitive header names.
|
|
7233
7304
|
*/
|
|
7234
7305
|
static checkResponseForRetryAfter(response) {
|
|
7235
|
-
|
|
7236
|
-
return (response.headers.hasOwnProperty(HeaderNames.RETRY_AFTER) &&
|
|
7237
|
-
(response.status < 200 || response.status >= 300));
|
|
7238
|
-
}
|
|
7239
|
-
return false;
|
|
7306
|
+
return getRetryAfterHeader(response) !== undefined;
|
|
7240
7307
|
}
|
|
7241
7308
|
/**
|
|
7242
7309
|
* Calculates the Unix-time value for a throttle to expire given throttleTime in seconds.
|
|
@@ -7253,6 +7320,13 @@ class ThrottlingUtils {
|
|
|
7253
7320
|
const key = this.generateThrottlingStorageKey(thumbprint);
|
|
7254
7321
|
cacheManager.removeItem(key, request.correlationId);
|
|
7255
7322
|
}
|
|
7323
|
+
}
|
|
7324
|
+
/** Reads Retry-After only for non-success responses. */
|
|
7325
|
+
function getRetryAfterHeader(response) {
|
|
7326
|
+
if ((response.status < 200 || response.status >= 300) && response.headers) {
|
|
7327
|
+
return getResponseHeader(response.headers, HeaderNames.RETRY_AFTER);
|
|
7328
|
+
}
|
|
7329
|
+
return undefined;
|
|
7256
7330
|
}
|
|
7257
7331
|
|
|
7258
7332
|
/*
|
|
@@ -7380,7 +7454,8 @@ async function sendPostRequest(thumbprint, tokenEndpoint, options, correlationId
|
|
|
7380
7454
|
let response;
|
|
7381
7455
|
try {
|
|
7382
7456
|
response = await invokeAsync((networkClient.sendPostRequestAsync.bind(networkClient)), NetworkClientSendPostRequestAsync, logger, performanceClient, correlationId)(tokenEndpoint, { ...options, correlationId, performanceClient });
|
|
7383
|
-
const responseHeaders = response.headers || {};
|
|
7457
|
+
const responseHeaders = normalizeResponseHeaders(response.headers || {});
|
|
7458
|
+
response = { ...response, headers: responseHeaders };
|
|
7384
7459
|
performanceClient?.addFields({
|
|
7385
7460
|
refreshTokenSize: response.body.refresh_token?.length || 0,
|
|
7386
7461
|
httpVerToken: responseHeaders[HeaderNames.X_MS_HTTP_VERSION] || "",
|
|
@@ -7389,16 +7464,16 @@ async function sendPostRequest(thumbprint, tokenEndpoint, options, correlationId
|
|
|
7389
7464
|
}
|
|
7390
7465
|
catch (e) {
|
|
7391
7466
|
if (e instanceof NetworkError) {
|
|
7392
|
-
const responseHeaders = e.responseHeaders
|
|
7467
|
+
const responseHeaders = e.responseHeaders
|
|
7468
|
+
? normalizeResponseHeaders(e.responseHeaders)
|
|
7469
|
+
: undefined;
|
|
7393
7470
|
if (responseHeaders) {
|
|
7394
7471
|
performanceClient?.addFields({
|
|
7395
7472
|
httpVerToken: responseHeaders[HeaderNames.X_MS_HTTP_VERSION] ||
|
|
7396
7473
|
"",
|
|
7397
7474
|
requestId: responseHeaders[HeaderNames.X_MS_REQUEST_ID] || "",
|
|
7398
|
-
contentTypeHeader: responseHeaders
|
|
7399
|
-
|
|
7400
|
-
contentLengthHeader: responseHeaders[HeaderNames.CONTENT_LENGTH] ||
|
|
7401
|
-
undefined,
|
|
7475
|
+
contentTypeHeader: getResponseHeader(responseHeaders, HeaderNames.CONTENT_TYPE) || undefined,
|
|
7476
|
+
contentLengthHeader: getResponseHeader(responseHeaders, HeaderNames.CONTENT_LENGTH) || undefined,
|
|
7402
7477
|
httpStatus: e.httpStatus,
|
|
7403
7478
|
}, correlationId);
|
|
7404
7479
|
}
|
|
@@ -7666,6 +7741,9 @@ class AuthorizationCodeClient {
|
|
|
7666
7741
|
if (request.logoutHint) {
|
|
7667
7742
|
addLogoutHint(parameters, request.logoutHint);
|
|
7668
7743
|
}
|
|
7744
|
+
if (request.popupOriginCheckDone) {
|
|
7745
|
+
addPopupOriginCheckDone(parameters);
|
|
7746
|
+
}
|
|
7669
7747
|
if (request.extraQueryParameters) {
|
|
7670
7748
|
addExtraParameters(parameters, request.extraQueryParameters);
|
|
7671
7749
|
}
|
|
@@ -8191,6 +8269,9 @@ function getStandardAuthorizeRequestParameters(authOptions, request, logger, per
|
|
|
8191
8269
|
!Object.keys(request.extraQueryParameters).includes(INSTANCE_AWARE))) {
|
|
8192
8270
|
addInstanceAware(parameters);
|
|
8193
8271
|
}
|
|
8272
|
+
if (request.popupOriginCheckDone) {
|
|
8273
|
+
addPopupOriginCheckDone(parameters);
|
|
8274
|
+
}
|
|
8194
8275
|
return parameters;
|
|
8195
8276
|
}
|
|
8196
8277
|
/**
|
|
@@ -8331,8 +8412,9 @@ function containsResourceParam(params) {
|
|
|
8331
8412
|
* header challenge values that can be used outside the basic authorization flows.
|
|
8332
8413
|
*/
|
|
8333
8414
|
class AuthenticationHeaderParser {
|
|
8415
|
+
/** Captures a case-insensitive snapshot of the response headers. */
|
|
8334
8416
|
constructor(headers) {
|
|
8335
|
-
this.headers = headers;
|
|
8417
|
+
this.headers = normalizeResponseHeaders(headers);
|
|
8336
8418
|
}
|
|
8337
8419
|
/**
|
|
8338
8420
|
* This method parses the SHR nonce value out of either the Authentication-Info or WWW-Authenticate authentication headers.
|
|
@@ -8340,7 +8422,7 @@ class AuthenticationHeaderParser {
|
|
|
8340
8422
|
*/
|
|
8341
8423
|
getShrNonce() {
|
|
8342
8424
|
// Attempt to parse nonce from Authentiacation-Info
|
|
8343
|
-
const authenticationInfo = this.headers
|
|
8425
|
+
const authenticationInfo = getResponseHeader(this.headers, HeaderNames.AuthenticationInfo);
|
|
8344
8426
|
if (authenticationInfo) {
|
|
8345
8427
|
const authenticationInfoChallenges = this.parseChallenges(authenticationInfo);
|
|
8346
8428
|
if (authenticationInfoChallenges.nextnonce) {
|
|
@@ -8349,7 +8431,7 @@ class AuthenticationHeaderParser {
|
|
|
8349
8431
|
throw createClientConfigurationError(invalidAuthenticationHeader, "");
|
|
8350
8432
|
}
|
|
8351
8433
|
// Attempt to parse nonce from WWW-Authenticate
|
|
8352
|
-
const wwwAuthenticate = this.headers
|
|
8434
|
+
const wwwAuthenticate = getResponseHeader(this.headers, HeaderNames.WWWAuthenticate);
|
|
8353
8435
|
if (wwwAuthenticate) {
|
|
8354
8436
|
const wwwAuthenticateChallenges = this.parseChallenges(wwwAuthenticate);
|
|
8355
8437
|
if (wwwAuthenticateChallenges.nonce) {
|
|
@@ -8793,4 +8875,4 @@ exports.invokeAsync = invokeAsync;
|
|
|
8793
8875
|
exports.tenantIdMatchesHomeTenant = tenantIdMatchesHomeTenant;
|
|
8794
8876
|
exports.updateAccountTenantProfileData = updateAccountTenantProfileData;
|
|
8795
8877
|
exports.version = version;
|
|
8796
|
-
//# sourceMappingURL=index-node-
|
|
8878
|
+
//# sourceMappingURL=index-node-DD4RzKVr.js.map
|