@azure/msal-common 14.8.1 → 14.9.1-alpha.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/ClientCredentials.d.ts +6 -1
- package/dist/account/ClientCredentials.d.ts.map +1 -1
- package/dist/account/ClientInfo.mjs +1 -1
- package/dist/account/TokenClaims.mjs +1 -1
- package/dist/authority/Authority.d.ts +3 -2
- package/dist/authority/Authority.d.ts.map +1 -1
- package/dist/authority/Authority.mjs +8 -4
- package/dist/authority/Authority.mjs.map +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.d.ts +4 -2
- package/dist/cache/CacheManager.d.ts.map +1 -1
- package/dist/cache/CacheManager.mjs +43 -17
- package/dist/cache/CacheManager.mjs.map +1 -1
- package/dist/cache/entities/AccountEntity.mjs +1 -1
- package/dist/cache/entities/CacheRecord.mjs +1 -1
- package/dist/cache/persistence/TokenCacheContext.mjs +1 -1
- package/dist/cache/utils/CacheHelpers.mjs +1 -1
- package/dist/client/AuthorizationCodeClient.d.ts.map +1 -1
- package/dist/client/AuthorizationCodeClient.mjs +8 -3
- package/dist/client/AuthorizationCodeClient.mjs.map +1 -1
- package/dist/client/BaseClient.mjs +1 -1
- package/dist/client/RefreshTokenClient.d.ts.map +1 -1
- package/dist/client/RefreshTokenClient.mjs +3 -2
- package/dist/client/RefreshTokenClient.mjs.map +1 -1
- package/dist/client/SilentFlowClient.mjs +1 -1
- package/dist/config/ClientConfiguration.d.ts.map +1 -1
- package/dist/config/ClientConfiguration.mjs +2 -4
- package/dist/config/ClientConfiguration.mjs.map +1 -1
- package/dist/constants/AADServerParamKeys.mjs +1 -1
- package/dist/crypto/ICrypto.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.d.ts +21 -0
- package/dist/error/CacheError.d.ts.map +1 -0
- package/dist/error/CacheError.mjs +33 -0
- package/dist/error/CacheError.mjs.map +1 -0
- package/dist/error/CacheErrorCodes.d.ts +3 -0
- package/dist/error/CacheErrorCodes.d.ts.map +1 -0
- package/dist/error/CacheErrorCodes.mjs +11 -0
- package/dist/error/CacheErrorCodes.mjs.map +1 -0
- 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.d.ts +5 -1
- package/dist/error/InteractionRequiredAuthError.d.ts.map +1 -1
- package/dist/error/InteractionRequiredAuthError.mjs +3 -2
- package/dist/error/InteractionRequiredAuthError.mjs.map +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/ServerError.d.ts +5 -1
- package/dist/error/ServerError.d.ts.map +1 -1
- package/dist/error/ServerError.mjs +3 -2
- package/dist/error/ServerError.mjs.map +1 -1
- package/dist/index.cjs +165 -43
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +8 -2
- package/dist/index.mjs.map +1 -1
- package/dist/logger/Logger.mjs +1 -1
- package/dist/network/INetworkModule.d.ts +1 -1
- package/dist/network/INetworkModule.d.ts.map +1 -1
- package/dist/network/INetworkModule.mjs +1 -1
- package/dist/network/NetworkManager.mjs +1 -1
- package/dist/network/ThrottlingUtils.mjs +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.d.ts.map +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/request/AuthenticationHeaderParser.mjs +1 -1
- package/dist/request/BaseAuthRequest.d.ts +2 -0
- package/dist/request/BaseAuthRequest.d.ts.map +1 -1
- package/dist/request/RequestParameterBuilder.mjs +1 -1
- package/dist/request/RequestParameterBuilder.mjs.map +1 -1
- package/dist/request/RequestValidator.mjs +1 -1
- package/dist/request/ScopeSet.mjs +1 -1
- package/dist/response/ResponseHandler.d.ts.map +1 -1
- package/dist/response/ResponseHandler.mjs +17 -6
- package/dist/response/ResponseHandler.mjs.map +1 -1
- package/dist/response/ServerAuthorizationCodeResponse.d.ts +1 -0
- package/dist/response/ServerAuthorizationCodeResponse.d.ts.map +1 -1
- package/dist/telemetry/performance/PerformanceClient.d.ts +1 -7
- package/dist/telemetry/performance/PerformanceClient.d.ts.map +1 -1
- package/dist/telemetry/performance/PerformanceClient.mjs +14 -11
- package/dist/telemetry/performance/PerformanceClient.mjs.map +1 -1
- package/dist/telemetry/performance/PerformanceEvent.d.ts +14 -0
- package/dist/telemetry/performance/PerformanceEvent.d.ts.map +1 -1
- package/dist/telemetry/performance/PerformanceEvent.mjs +2 -1
- package/dist/telemetry/performance/PerformanceEvent.mjs.map +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.d.ts +3 -0
- package/dist/utils/ClientAssertionUtils.d.ts.map +1 -0
- package/dist/utils/ClientAssertionUtils.mjs +21 -0
- package/dist/utils/ClientAssertionUtils.mjs.map +1 -0
- package/dist/utils/Constants.d.ts +12 -0
- package/dist/utils/Constants.d.ts.map +1 -1
- package/dist/utils/Constants.mjs +15 -2
- package/dist/utils/Constants.mjs.map +1 -1
- package/dist/utils/FunctionWrappers.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/package.json +3 -3
- package/src/account/ClientCredentials.ts +10 -1
- package/src/authority/Authority.ts +9 -3
- package/src/cache/CacheManager.ts +58 -19
- package/src/client/AuthorizationCodeClient.ts +20 -3
- package/src/client/RefreshTokenClient.ts +11 -2
- package/src/config/ClientConfiguration.ts +4 -4
- package/src/error/CacheError.ts +44 -0
- package/src/error/CacheErrorCodes.ts +7 -0
- package/src/error/InteractionRequiredAuthError.ts +8 -1
- package/src/error/ServerError.ts +12 -1
- package/src/index.ts +9 -1
- package/src/network/INetworkModule.ts +1 -1
- package/src/packageMetadata.ts +1 -1
- package/src/request/BaseAuthRequest.ts +2 -0
- package/src/response/ResponseHandler.ts +27 -5
- package/src/response/ServerAuthorizationCodeResponse.ts +1 -0
- package/src/telemetry/performance/PerformanceClient.ts +14 -11
- package/src/telemetry/performance/PerformanceEvent.ts +21 -0
- package/src/utils/ClientAssertionUtils.ts +25 -0
- package/src/utils/Constants.ts +14 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-common v14.
|
|
1
|
+
/*! @azure/msal-common v14.9.1-alpha.0 2024-05-01 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { AuthError } from './AuthError.mjs';
|
|
4
4
|
import { redirectUriEmpty, claimsRequestParsingError, authorityUriInsecure, urlParseError, urlEmptyError, emptyInputScopesError, invalidPromptValue, invalidClaims, tokenRequestEmpty, logoutRequestEmpty, invalidCodeChallengeMethod, pkceParamsMissing, invalidCloudDiscoveryMetadata, invalidAuthorityMetadata, untrustedAuthority, missingSshJwk, missingSshKid, missingNonceAuthenticationHeader, invalidAuthenticationHeader, cannotSetOIDCOptions, cannotAllowNativeBroker, authorityMismatch } from './ClientConfigurationErrorCodes.mjs';
|
|
@@ -46,7 +46,11 @@ export declare class InteractionRequiredAuthError extends AuthError {
|
|
|
46
46
|
* app to app context (client_credentials): include the claims in the AcquireTokenByClientCredential request
|
|
47
47
|
*/
|
|
48
48
|
claims: string;
|
|
49
|
-
|
|
49
|
+
/**
|
|
50
|
+
* Server error number;
|
|
51
|
+
*/
|
|
52
|
+
readonly errorNo?: string;
|
|
53
|
+
constructor(errorCode?: string, errorMessage?: string, subError?: string, timestamp?: string, traceId?: string, correlationId?: string, claims?: string, errorNo?: string);
|
|
50
54
|
}
|
|
51
55
|
/**
|
|
52
56
|
* Helper function used to determine if an error thrown by the server requires interaction to resolve
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InteractionRequiredAuthError.d.ts","sourceRoot":"","sources":["../../src/error/InteractionRequiredAuthError.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,iCAAiC,MAAM,qCAAqC,CAAC;AACzF,OAAO,EAAE,iCAAiC,EAAE,CAAC;AAE7C;;GAEG;AACH,eAAO,MAAM,qCAAqC,UAKjD,CAAC;AAEF,eAAO,MAAM,sCAAsC,UAOlD,CAAC;AAaF;;;GAGG;AACH,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;CAmB/C,CAAC;AAEF;;GAEG;AACH,qBAAa,4BAA6B,SAAQ,SAAS;IACvD;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;;;;;;OAQG;IACH,MAAM,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"InteractionRequiredAuthError.d.ts","sourceRoot":"","sources":["../../src/error/InteractionRequiredAuthError.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,iCAAiC,MAAM,qCAAqC,CAAC;AACzF,OAAO,EAAE,iCAAiC,EAAE,CAAC;AAE7C;;GAEG;AACH,eAAO,MAAM,qCAAqC,UAKjD,CAAC;AAEF,eAAO,MAAM,sCAAsC,UAOlD,CAAC;AAaF;;;GAGG;AACH,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;CAmB/C,CAAC;AAEF;;GAEG;AACH,qBAAa,4BAA6B,SAAQ,SAAS;IACvD;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;;;;;;OAQG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;gBAGtB,SAAS,CAAC,EAAE,MAAM,EAClB,YAAY,CAAC,EAAE,MAAM,EACrB,QAAQ,CAAC,EAAE,MAAM,EACjB,SAAS,CAAC,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,MAAM,EAChB,aAAa,CAAC,EAAE,MAAM,EACtB,MAAM,CAAC,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,MAAM;CAYvB;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACtC,SAAS,CAAC,EAAE,MAAM,EAClB,WAAW,CAAC,EAAE,MAAM,EACpB,QAAQ,CAAC,EAAE,MAAM,GAClB,OAAO,CAkBT;AAED;;GAEG;AACH,wBAAgB,kCAAkC,CAC9C,SAAS,EAAE,MAAM,GAClB,4BAA4B,CAK9B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-common v14.
|
|
1
|
+
/*! @azure/msal-common v14.9.1-alpha.0 2024-05-01 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { Constants } from '../utils/Constants.mjs';
|
|
4
4
|
import { AuthError } from './AuthError.mjs';
|
|
@@ -55,7 +55,7 @@ const InteractionRequiredAuthErrorMessage = {
|
|
|
55
55
|
* Error thrown when user interaction is required.
|
|
56
56
|
*/
|
|
57
57
|
class InteractionRequiredAuthError extends AuthError {
|
|
58
|
-
constructor(errorCode, errorMessage, subError, timestamp, traceId, correlationId, claims) {
|
|
58
|
+
constructor(errorCode, errorMessage, subError, timestamp, traceId, correlationId, claims, errorNo) {
|
|
59
59
|
super(errorCode, errorMessage, subError);
|
|
60
60
|
Object.setPrototypeOf(this, InteractionRequiredAuthError.prototype);
|
|
61
61
|
this.timestamp = timestamp || Constants.EMPTY_STRING;
|
|
@@ -63,6 +63,7 @@ class InteractionRequiredAuthError extends AuthError {
|
|
|
63
63
|
this.correlationId = correlationId || Constants.EMPTY_STRING;
|
|
64
64
|
this.claims = claims || Constants.EMPTY_STRING;
|
|
65
65
|
this.name = "InteractionRequiredAuthError";
|
|
66
|
+
this.errorNo = errorNo;
|
|
66
67
|
}
|
|
67
68
|
}
|
|
68
69
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InteractionRequiredAuthError.mjs","sources":["../../src/error/InteractionRequiredAuthError.ts"],"sourcesContent":[null],"names":["InteractionRequiredAuthErrorCodes.interactionRequired","InteractionRequiredAuthErrorCodes.consentRequired","InteractionRequiredAuthErrorCodes.loginRequired","InteractionRequiredAuthErrorCodes.badToken","InteractionRequiredAuthErrorCodes.noTokensFound","InteractionRequiredAuthErrorCodes.nativeAccountUnavailable","InteractionRequiredAuthErrorCodes.refreshTokenExpired"],"mappings":";;;;;;;;AAAA;;;AAGG;AAOH;;AAEG;AACU,MAAA,qCAAqC,GAAG;AACjD,IAAAA,mBAAqD;AACrD,IAAAC,eAAiD;AACjD,IAAAC,aAA+C;AAC/C,IAAAC,QAA0C;EAC5C;AAEW,MAAA,sCAAsC,GAAG;IAClD,cAAc;IACd,mBAAmB;IACnB,cAAc;IACd,uBAAuB;IACvB,kBAAkB;IAClB,WAAW;EACb;AAEF,MAAM,oCAAoC,GAAG;AACzC,IAAA,CAACC,aAA+C,GAC5C,sDAAsD;AAC1D,IAAA,CAACC,wBAA0D,GACvD,qJAAqJ;AACzJ,IAAA,CAACC,mBAAqD,GAClD,4BAA4B;AAChC,IAAA,CAACH,QAA0C,GACvC,+HAA+H;CACtI,CAAC;AAEF;;;AAGG;AACU,MAAA,mCAAmC,GAAG;AAC/C,IAAA,kBAAkB,EAAE;QAChB,IAAI,EAAEC,aAA+C;AACrD,QAAA,IAAI,EAAE,oCAAoC,CACtCA,aAA+C,CAClD;AACJ,KAAA;AACD,IAAA,0BAA0B,EAAE;QACxB,IAAI,EAAEC,wBAA0D;AAChE,QAAA,IAAI,EAAE,oCAAoC,CACtCA,wBAA0D,CAC7D;AACJ,KAAA;AACD,IAAA,SAAS,EAAE;QACP,IAAI,EAAEF,QAA0C;AAChD,QAAA,IAAI,EAAE,oCAAoC,CACtCA,QAA0C,CAC7C;AACJ,KAAA;EACH;AAEF;;AAEG;AACG,MAAO,4BAA6B,SAAQ,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"InteractionRequiredAuthError.mjs","sources":["../../src/error/InteractionRequiredAuthError.ts"],"sourcesContent":[null],"names":["InteractionRequiredAuthErrorCodes.interactionRequired","InteractionRequiredAuthErrorCodes.consentRequired","InteractionRequiredAuthErrorCodes.loginRequired","InteractionRequiredAuthErrorCodes.badToken","InteractionRequiredAuthErrorCodes.noTokensFound","InteractionRequiredAuthErrorCodes.nativeAccountUnavailable","InteractionRequiredAuthErrorCodes.refreshTokenExpired"],"mappings":";;;;;;;;AAAA;;;AAGG;AAOH;;AAEG;AACU,MAAA,qCAAqC,GAAG;AACjD,IAAAA,mBAAqD;AACrD,IAAAC,eAAiD;AACjD,IAAAC,aAA+C;AAC/C,IAAAC,QAA0C;EAC5C;AAEW,MAAA,sCAAsC,GAAG;IAClD,cAAc;IACd,mBAAmB;IACnB,cAAc;IACd,uBAAuB;IACvB,kBAAkB;IAClB,WAAW;EACb;AAEF,MAAM,oCAAoC,GAAG;AACzC,IAAA,CAACC,aAA+C,GAC5C,sDAAsD;AAC1D,IAAA,CAACC,wBAA0D,GACvD,qJAAqJ;AACzJ,IAAA,CAACC,mBAAqD,GAClD,4BAA4B;AAChC,IAAA,CAACH,QAA0C,GACvC,+HAA+H;CACtI,CAAC;AAEF;;;AAGG;AACU,MAAA,mCAAmC,GAAG;AAC/C,IAAA,kBAAkB,EAAE;QAChB,IAAI,EAAEC,aAA+C;AACrD,QAAA,IAAI,EAAE,oCAAoC,CACtCA,aAA+C,CAClD;AACJ,KAAA;AACD,IAAA,0BAA0B,EAAE;QACxB,IAAI,EAAEC,wBAA0D;AAChE,QAAA,IAAI,EAAE,oCAAoC,CACtCA,wBAA0D,CAC7D;AACJ,KAAA;AACD,IAAA,SAAS,EAAE;QACP,IAAI,EAAEF,QAA0C;AAChD,QAAA,IAAI,EAAE,oCAAoC,CACtCA,QAA0C,CAC7C;AACJ,KAAA;EACH;AAEF;;AAEG;AACG,MAAO,4BAA6B,SAAQ,SAAS,CAAA;AA2BvD,IAAA,WAAA,CACI,SAAkB,EAClB,YAAqB,EACrB,QAAiB,EACjB,SAAkB,EAClB,OAAgB,EAChB,aAAsB,EACtB,MAAe,EACf,OAAgB,EAAA;AAEhB,QAAA,KAAK,CAAC,SAAS,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAC;QACzC,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,4BAA4B,CAAC,SAAS,CAAC,CAAC;QAEpE,IAAI,CAAC,SAAS,GAAG,SAAS,IAAI,SAAS,CAAC,YAAY,CAAC;QACrD,IAAI,CAAC,OAAO,GAAG,OAAO,IAAI,SAAS,CAAC,YAAY,CAAC;QACjD,IAAI,CAAC,aAAa,GAAG,aAAa,IAAI,SAAS,CAAC,YAAY,CAAC;QAC7D,IAAI,CAAC,MAAM,GAAG,MAAM,IAAI,SAAS,CAAC,YAAY,CAAC;AAC/C,QAAA,IAAI,CAAC,IAAI,GAAG,8BAA8B,CAAC;AAC3C,QAAA,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;KAC1B;AACJ,CAAA;AAED;;;;;AAKG;SACa,0BAA0B,CACtC,SAAkB,EAClB,WAAoB,EACpB,QAAiB,EAAA;AAEjB,IAAA,MAAM,8BAA8B,GAChC,CAAC,CAAC,SAAS;QACX,qCAAqC,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;AAClE,IAAA,MAAM,6BAA6B,GAC/B,CAAC,CAAC,QAAQ;QACV,sCAAsC,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;AAClE,IAAA,MAAM,8BAA8B,GAChC,CAAC,CAAC,WAAW;AACb,QAAA,qCAAqC,CAAC,IAAI,CAAC,CAAC,WAAW,KAAI;YACvD,OAAO,WAAW,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;AACjD,SAAC,CAAC,CAAC;AAEP,IAAA,QACI,8BAA8B;QAC9B,8BAA8B;AAC9B,QAAA,6BAA6B,EAC/B;AACN,CAAC;AAED;;AAEG;AACG,SAAU,kCAAkC,CAC9C,SAAiB,EAAA;IAEjB,OAAO,IAAI,4BAA4B,CACnC,SAAS,EACT,oCAAoC,CAAC,SAAS,CAAC,CAClD,CAAC;AACN;;;;"}
|
|
@@ -3,6 +3,10 @@ import { AuthError } from "./AuthError";
|
|
|
3
3
|
* Error thrown when there is an error with the server code, for example, unavailability.
|
|
4
4
|
*/
|
|
5
5
|
export declare class ServerError extends AuthError {
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Server error number;
|
|
8
|
+
*/
|
|
9
|
+
readonly errorNo?: string;
|
|
10
|
+
constructor(errorCode?: string, errorMessage?: string, subError?: string, errorNo?: string);
|
|
7
11
|
}
|
|
8
12
|
//# sourceMappingURL=ServerError.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServerError.d.ts","sourceRoot":"","sources":["../../src/error/ServerError.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;GAEG;AACH,qBAAa,WAAY,SAAQ,SAAS;
|
|
1
|
+
{"version":3,"file":"ServerError.d.ts","sourceRoot":"","sources":["../../src/error/ServerError.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;GAEG;AACH,qBAAa,WAAY,SAAQ,SAAS;IACtC;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;gBAGtB,SAAS,CAAC,EAAE,MAAM,EAClB,YAAY,CAAC,EAAE,MAAM,EACrB,QAAQ,CAAC,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,MAAM;CAQvB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-common v14.
|
|
1
|
+
/*! @azure/msal-common v14.9.1-alpha.0 2024-05-01 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { AuthError } from './AuthError.mjs';
|
|
4
4
|
|
|
@@ -10,9 +10,10 @@ import { AuthError } from './AuthError.mjs';
|
|
|
10
10
|
* Error thrown when there is an error with the server code, for example, unavailability.
|
|
11
11
|
*/
|
|
12
12
|
class ServerError extends AuthError {
|
|
13
|
-
constructor(errorCode, errorMessage, subError) {
|
|
13
|
+
constructor(errorCode, errorMessage, subError, errorNo) {
|
|
14
14
|
super(errorCode, errorMessage, subError);
|
|
15
15
|
this.name = "ServerError";
|
|
16
|
+
this.errorNo = errorNo;
|
|
16
17
|
Object.setPrototypeOf(this, ServerError.prototype);
|
|
17
18
|
}
|
|
18
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServerError.mjs","sources":["../../src/error/ServerError.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAAA;;;AAGG;AAIH;;AAEG;AACG,MAAO,WAAY,SAAQ,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"ServerError.mjs","sources":["../../src/error/ServerError.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAAA;;;AAGG;AAIH;;AAEG;AACG,MAAO,WAAY,SAAQ,SAAS,CAAA;AAMtC,IAAA,WAAA,CACI,SAAkB,EAClB,YAAqB,EACrB,QAAiB,EACjB,OAAgB,EAAA;AAEhB,QAAA,KAAK,CAAC,SAAS,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAC;AACzC,QAAA,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;AAC1B,QAAA,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAEvB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;KACtD;AACJ;;;;"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-common v14.
|
|
1
|
+
/*! @azure/msal-common v14.9.1-alpha.0 2024-05-01 */
|
|
2
2
|
'use strict';
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
@@ -65,13 +65,24 @@ const Constants = {
|
|
|
65
65
|
INVALID_INSTANCE: "invalid_instance",
|
|
66
66
|
};
|
|
67
67
|
const HttpStatus = {
|
|
68
|
+
SUCCESS: 200,
|
|
68
69
|
SUCCESS_RANGE_START: 200,
|
|
69
70
|
SUCCESS_RANGE_END: 299,
|
|
70
71
|
REDIRECT: 302,
|
|
72
|
+
CLIENT_ERROR: 400,
|
|
71
73
|
CLIENT_ERROR_RANGE_START: 400,
|
|
74
|
+
BAD_REQUEST: 400,
|
|
75
|
+
UNAUTHORIZED: 401,
|
|
76
|
+
NOT_FOUND: 404,
|
|
77
|
+
REQUEST_TIMEOUT: 408,
|
|
78
|
+
TOO_MANY_REQUESTS: 429,
|
|
72
79
|
CLIENT_ERROR_RANGE_END: 499,
|
|
80
|
+
SERVER_ERROR: 500,
|
|
73
81
|
SERVER_ERROR_RANGE_START: 500,
|
|
82
|
+
SERVICE_UNAVAILABLE: 503,
|
|
83
|
+
GATEWAY_TIMEOUT: 504,
|
|
74
84
|
SERVER_ERROR_RANGE_END: 599,
|
|
85
|
+
MULTI_SIDED_ERROR: 600,
|
|
75
86
|
};
|
|
76
87
|
const OIDC_DEFAULT_SCOPES = [
|
|
77
88
|
Constants.OPENID_SCOPE,
|
|
@@ -310,6 +321,8 @@ const JsonWebTokenTypes = {
|
|
|
310
321
|
Pop: "pop",
|
|
311
322
|
};
|
|
312
323
|
const ONE_DAY_IN_MS = 86400000;
|
|
324
|
+
// Token renewal offset default in seconds
|
|
325
|
+
const DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;
|
|
313
326
|
|
|
314
327
|
/*
|
|
315
328
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -943,7 +956,7 @@ class Logger {
|
|
|
943
956
|
|
|
944
957
|
/* eslint-disable header/header */
|
|
945
958
|
const name = "@azure/msal-common";
|
|
946
|
-
const version = "14.
|
|
959
|
+
const version = "14.9.1-alpha.0";
|
|
947
960
|
|
|
948
961
|
/*
|
|
949
962
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2653,6 +2666,44 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
|
|
|
2653
2666
|
return null;
|
|
2654
2667
|
}
|
|
2655
2668
|
|
|
2669
|
+
/*
|
|
2670
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2671
|
+
* Licensed under the MIT License.
|
|
2672
|
+
*/
|
|
2673
|
+
const cacheQuotaExceededErrorCode = "cache_quota_exceeded";
|
|
2674
|
+
const cacheUnknownErrorCode = "cache_error_unknown";
|
|
2675
|
+
|
|
2676
|
+
var CacheErrorCodes = /*#__PURE__*/Object.freeze({
|
|
2677
|
+
__proto__: null,
|
|
2678
|
+
cacheQuotaExceededErrorCode: cacheQuotaExceededErrorCode,
|
|
2679
|
+
cacheUnknownErrorCode: cacheUnknownErrorCode
|
|
2680
|
+
});
|
|
2681
|
+
|
|
2682
|
+
/*
|
|
2683
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2684
|
+
* Licensed under the MIT License.
|
|
2685
|
+
*/
|
|
2686
|
+
const CacheErrorMessages = {
|
|
2687
|
+
[cacheQuotaExceededErrorCode]: "Exceeded cache storage capacity.",
|
|
2688
|
+
[cacheUnknownErrorCode]: "Unexpected error occurred when using cache storage.",
|
|
2689
|
+
};
|
|
2690
|
+
/**
|
|
2691
|
+
* Error thrown when there is an error with the cache
|
|
2692
|
+
*/
|
|
2693
|
+
class CacheError extends Error {
|
|
2694
|
+
constructor(errorCode, errorMessage) {
|
|
2695
|
+
const message = errorMessage ||
|
|
2696
|
+
(CacheErrorMessages[errorCode]
|
|
2697
|
+
? CacheErrorMessages[errorCode]
|
|
2698
|
+
: CacheErrorMessages[cacheUnknownErrorCode]);
|
|
2699
|
+
super(`${errorCode}: ${message}`);
|
|
2700
|
+
Object.setPrototypeOf(this, CacheError.prototype);
|
|
2701
|
+
this.name = "CacheError";
|
|
2702
|
+
this.errorCode = errorCode;
|
|
2703
|
+
this.errorMessage = message;
|
|
2704
|
+
}
|
|
2705
|
+
}
|
|
2706
|
+
|
|
2656
2707
|
/*
|
|
2657
2708
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2658
2709
|
* Licensed under the MIT License.
|
|
@@ -2815,27 +2866,51 @@ class CacheManager {
|
|
|
2815
2866
|
}
|
|
2816
2867
|
/**
|
|
2817
2868
|
* saves a cache record
|
|
2818
|
-
* @param cacheRecord
|
|
2869
|
+
* @param cacheRecord {CacheRecord}
|
|
2870
|
+
* @param storeInCache {?StoreInCache}
|
|
2871
|
+
* @param correlationId {?string} correlation id
|
|
2819
2872
|
*/
|
|
2820
|
-
async saveCacheRecord(cacheRecord, storeInCache) {
|
|
2873
|
+
async saveCacheRecord(cacheRecord, storeInCache, correlationId) {
|
|
2821
2874
|
if (!cacheRecord) {
|
|
2822
2875
|
throw createClientAuthError(invalidCacheRecord);
|
|
2823
2876
|
}
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2877
|
+
try {
|
|
2878
|
+
if (!!cacheRecord.account) {
|
|
2879
|
+
this.setAccount(cacheRecord.account);
|
|
2880
|
+
}
|
|
2881
|
+
if (!!cacheRecord.idToken && storeInCache?.idToken !== false) {
|
|
2882
|
+
this.setIdTokenCredential(cacheRecord.idToken);
|
|
2883
|
+
}
|
|
2884
|
+
if (!!cacheRecord.accessToken &&
|
|
2885
|
+
storeInCache?.accessToken !== false) {
|
|
2886
|
+
await this.saveAccessToken(cacheRecord.accessToken);
|
|
2887
|
+
}
|
|
2888
|
+
if (!!cacheRecord.refreshToken &&
|
|
2889
|
+
storeInCache?.refreshToken !== false) {
|
|
2890
|
+
this.setRefreshTokenCredential(cacheRecord.refreshToken);
|
|
2891
|
+
}
|
|
2892
|
+
if (!!cacheRecord.appMetadata) {
|
|
2893
|
+
this.setAppMetadata(cacheRecord.appMetadata);
|
|
2894
|
+
}
|
|
2836
2895
|
}
|
|
2837
|
-
|
|
2838
|
-
this.
|
|
2896
|
+
catch (e) {
|
|
2897
|
+
this.commonLogger?.error(`CacheManager.saveCacheRecord: failed`);
|
|
2898
|
+
if (e instanceof Error) {
|
|
2899
|
+
this.commonLogger?.errorPii(`CacheManager.saveCacheRecord: ${e.message}`, correlationId);
|
|
2900
|
+
if (e.name === "QuotaExceededError" ||
|
|
2901
|
+
e.name === "NS_ERROR_DOM_QUOTA_REACHED" ||
|
|
2902
|
+
e.message.includes("exceeded the quota")) {
|
|
2903
|
+
this.commonLogger?.error(`CacheManager.saveCacheRecord: exceeded storage quota`, correlationId);
|
|
2904
|
+
throw new CacheError(cacheQuotaExceededErrorCode);
|
|
2905
|
+
}
|
|
2906
|
+
else {
|
|
2907
|
+
throw new CacheError(e.name, e.message);
|
|
2908
|
+
}
|
|
2909
|
+
}
|
|
2910
|
+
else {
|
|
2911
|
+
this.commonLogger?.errorPii(`CacheManager.saveCacheRecord: ${e}`, correlationId);
|
|
2912
|
+
throw new CacheError(cacheUnknownErrorCode);
|
|
2913
|
+
}
|
|
2839
2914
|
}
|
|
2840
2915
|
}
|
|
2841
2916
|
/**
|
|
@@ -3886,8 +3961,6 @@ class DefaultStorageClass extends CacheManager {
|
|
|
3886
3961
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3887
3962
|
* Licensed under the MIT License.
|
|
3888
3963
|
*/
|
|
3889
|
-
// Token renewal offset default in seconds
|
|
3890
|
-
const DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;
|
|
3891
3964
|
const DEFAULT_SYSTEM_OPTIONS = {
|
|
3892
3965
|
tokenRenewalOffsetSeconds: DEFAULT_TOKEN_RENEWAL_OFFSET_SEC,
|
|
3893
3966
|
preventCorsPreflight: false,
|
|
@@ -3988,9 +4061,10 @@ function isOidcProtocolMode(config) {
|
|
|
3988
4061
|
* Error thrown when there is an error with the server code, for example, unavailability.
|
|
3989
4062
|
*/
|
|
3990
4063
|
class ServerError extends AuthError {
|
|
3991
|
-
constructor(errorCode, errorMessage, subError) {
|
|
4064
|
+
constructor(errorCode, errorMessage, subError, errorNo) {
|
|
3992
4065
|
super(errorCode, errorMessage, subError);
|
|
3993
4066
|
this.name = "ServerError";
|
|
4067
|
+
this.errorNo = errorNo;
|
|
3994
4068
|
Object.setPrototypeOf(this, ServerError.prototype);
|
|
3995
4069
|
}
|
|
3996
4070
|
}
|
|
@@ -4802,6 +4876,7 @@ const PerformanceEvents = {
|
|
|
4802
4876
|
* Used to acquire a new set of tokens from the authorize endpoint in a hidden iframe.
|
|
4803
4877
|
*/
|
|
4804
4878
|
SilentIframeClientAcquireToken: "silentIframeClientAcquireToken",
|
|
4879
|
+
AwaitConcurrentIframe: "awaitConcurrentIframe",
|
|
4805
4880
|
/**
|
|
4806
4881
|
* acquireToken API in SilentRereshClient (msal-browser).
|
|
4807
4882
|
* Used to acquire a new set of tokens from the token endpoint using a refresh token.
|
|
@@ -5426,7 +5501,7 @@ RegionDiscovery.IMDS_OPTIONS = {
|
|
|
5426
5501
|
* @internal
|
|
5427
5502
|
*/
|
|
5428
5503
|
class Authority {
|
|
5429
|
-
constructor(authority, networkInterface, cacheManager, authorityOptions, logger, correlationId, performanceClient) {
|
|
5504
|
+
constructor(authority, networkInterface, cacheManager, authorityOptions, logger, correlationId, performanceClient, managedIdentity) {
|
|
5430
5505
|
this.canonicalAuthority = authority;
|
|
5431
5506
|
this._canonicalAuthority.validateAsUri();
|
|
5432
5507
|
this.networkInterface = networkInterface;
|
|
@@ -5440,6 +5515,7 @@ class Authority {
|
|
|
5440
5515
|
this.logger = logger;
|
|
5441
5516
|
this.performanceClient = performanceClient;
|
|
5442
5517
|
this.correlationId = correlationId;
|
|
5518
|
+
this.managedIdentity = managedIdentity || false;
|
|
5443
5519
|
this.regionDiscovery = new RegionDiscovery(networkInterface, this.logger, this.performanceClient, this.correlationId);
|
|
5444
5520
|
}
|
|
5445
5521
|
/**
|
|
@@ -5645,7 +5721,7 @@ class Authority {
|
|
|
5645
5721
|
return `${this.canonicalAuthority}v2.0/.well-known/openid-configuration`;
|
|
5646
5722
|
}
|
|
5647
5723
|
/**
|
|
5648
|
-
* Boolean that returns
|
|
5724
|
+
* Boolean that returns whether or not tenant discovery has been completed.
|
|
5649
5725
|
*/
|
|
5650
5726
|
discoveryComplete() {
|
|
5651
5727
|
return !!this.metadata;
|
|
@@ -6097,7 +6173,10 @@ class Authority {
|
|
|
6097
6173
|
* helper function to generate environment from authority object
|
|
6098
6174
|
*/
|
|
6099
6175
|
getPreferredCache() {
|
|
6100
|
-
if (this.
|
|
6176
|
+
if (this.managedIdentity) {
|
|
6177
|
+
return Constants.DEFAULT_AUTHORITY_HOST;
|
|
6178
|
+
}
|
|
6179
|
+
else if (this.discoveryComplete()) {
|
|
6101
6180
|
return this.metadata.preferred_cache;
|
|
6102
6181
|
}
|
|
6103
6182
|
else {
|
|
@@ -6458,7 +6537,7 @@ const InteractionRequiredAuthErrorMessage = {
|
|
|
6458
6537
|
* Error thrown when user interaction is required.
|
|
6459
6538
|
*/
|
|
6460
6539
|
class InteractionRequiredAuthError extends AuthError {
|
|
6461
|
-
constructor(errorCode, errorMessage, subError, timestamp, traceId, correlationId, claims) {
|
|
6540
|
+
constructor(errorCode, errorMessage, subError, timestamp, traceId, correlationId, claims, errorNo) {
|
|
6462
6541
|
super(errorCode, errorMessage, subError);
|
|
6463
6542
|
Object.setPrototypeOf(this, InteractionRequiredAuthError.prototype);
|
|
6464
6543
|
this.timestamp = timestamp || Constants.EMPTY_STRING;
|
|
@@ -6466,6 +6545,7 @@ class InteractionRequiredAuthError extends AuthError {
|
|
|
6466
6545
|
this.correlationId = correlationId || Constants.EMPTY_STRING;
|
|
6467
6546
|
this.claims = claims || Constants.EMPTY_STRING;
|
|
6468
6547
|
this.name = "InteractionRequiredAuthError";
|
|
6548
|
+
this.errorNo = errorNo;
|
|
6469
6549
|
}
|
|
6470
6550
|
}
|
|
6471
6551
|
/**
|
|
@@ -6692,6 +6772,13 @@ class PopTokenGenerator {
|
|
|
6692
6772
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6693
6773
|
* Licensed under the MIT License.
|
|
6694
6774
|
*/
|
|
6775
|
+
function parseServerErrorNo(serverResponse) {
|
|
6776
|
+
const errorCodePrefix = "code=";
|
|
6777
|
+
const errorCodePrefixIndex = serverResponse.error_uri?.lastIndexOf(errorCodePrefix);
|
|
6778
|
+
return errorCodePrefixIndex && errorCodePrefixIndex >= 0
|
|
6779
|
+
? serverResponse.error_uri?.substring(errorCodePrefixIndex + errorCodePrefix.length)
|
|
6780
|
+
: undefined;
|
|
6781
|
+
}
|
|
6695
6782
|
/**
|
|
6696
6783
|
* Class that handles response parsing.
|
|
6697
6784
|
* @internal
|
|
@@ -6739,10 +6826,11 @@ class ResponseHandler {
|
|
|
6739
6826
|
if (serverResponse.error ||
|
|
6740
6827
|
serverResponse.error_description ||
|
|
6741
6828
|
serverResponse.suberror) {
|
|
6829
|
+
const serverErrorNo = parseServerErrorNo(serverResponse);
|
|
6742
6830
|
if (isInteractionRequiredError(serverResponse.error, serverResponse.error_description, serverResponse.suberror)) {
|
|
6743
|
-
throw new InteractionRequiredAuthError(serverResponse.error || "", serverResponse.error_description, serverResponse.suberror, serverResponse.timestamp || "", serverResponse.trace_id || "", serverResponse.correlation_id || "", serverResponse.claims || "");
|
|
6831
|
+
throw new InteractionRequiredAuthError(serverResponse.error || "", serverResponse.error_description, serverResponse.suberror, serverResponse.timestamp || "", serverResponse.trace_id || "", serverResponse.correlation_id || "", serverResponse.claims || "", serverErrorNo);
|
|
6744
6832
|
}
|
|
6745
|
-
throw new ServerError(serverResponse.error || "", serverResponse.error_description, serverResponse.suberror);
|
|
6833
|
+
throw new ServerError(serverResponse.error || "", serverResponse.error_description, serverResponse.suberror, serverErrorNo);
|
|
6746
6834
|
}
|
|
6747
6835
|
}
|
|
6748
6836
|
/**
|
|
@@ -6756,7 +6844,10 @@ class ResponseHandler {
|
|
|
6756
6844
|
serverResponse.error_description ||
|
|
6757
6845
|
serverResponse.suberror) {
|
|
6758
6846
|
const errString = `${serverResponse.error_codes} - [${serverResponse.timestamp}]: ${serverResponse.error_description} - Correlation ID: ${serverResponse.correlation_id} - Trace ID: ${serverResponse.trace_id}`;
|
|
6759
|
-
const
|
|
6847
|
+
const serverErrorNo = serverResponse.error_codes?.length
|
|
6848
|
+
? serverResponse.error_codes[0]
|
|
6849
|
+
: undefined;
|
|
6850
|
+
const serverError = new ServerError(serverResponse.error, errString, serverResponse.suberror, serverErrorNo);
|
|
6760
6851
|
// check if 500 error
|
|
6761
6852
|
if (refreshAccessToken &&
|
|
6762
6853
|
serverResponse.status &&
|
|
@@ -6776,7 +6867,7 @@ class ResponseHandler {
|
|
|
6776
6867
|
return;
|
|
6777
6868
|
}
|
|
6778
6869
|
if (isInteractionRequiredError(serverResponse.error, serverResponse.error_description, serverResponse.suberror)) {
|
|
6779
|
-
throw new InteractionRequiredAuthError(serverResponse.error, serverResponse.error_description, serverResponse.suberror, serverResponse.timestamp || Constants.EMPTY_STRING, serverResponse.trace_id || Constants.EMPTY_STRING, serverResponse.correlation_id || Constants.EMPTY_STRING, serverResponse.claims || Constants.EMPTY_STRING);
|
|
6870
|
+
throw new InteractionRequiredAuthError(serverResponse.error, serverResponse.error_description, serverResponse.suberror, serverResponse.timestamp || Constants.EMPTY_STRING, serverResponse.trace_id || Constants.EMPTY_STRING, serverResponse.correlation_id || Constants.EMPTY_STRING, serverResponse.claims || Constants.EMPTY_STRING, serverErrorNo);
|
|
6780
6871
|
}
|
|
6781
6872
|
throw serverError;
|
|
6782
6873
|
}
|
|
@@ -6841,7 +6932,7 @@ class ResponseHandler {
|
|
|
6841
6932
|
return await ResponseHandler.generateAuthenticationResult(this.cryptoObj, authority, cacheRecord, false, request, idTokenClaims, requestStateObj, undefined, serverRequestId);
|
|
6842
6933
|
}
|
|
6843
6934
|
}
|
|
6844
|
-
await this.cacheStorage.saveCacheRecord(cacheRecord, request.storeInCache);
|
|
6935
|
+
await this.cacheStorage.saveCacheRecord(cacheRecord, request.storeInCache, request.correlationId);
|
|
6845
6936
|
}
|
|
6846
6937
|
finally {
|
|
6847
6938
|
if (this.persistencePlugin &&
|
|
@@ -7039,6 +7130,28 @@ function buildAccountToCache(cacheStorage, authority, homeAccountId, idTokenClai
|
|
|
7039
7130
|
return baseAccount;
|
|
7040
7131
|
}
|
|
7041
7132
|
|
|
7133
|
+
/*
|
|
7134
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
7135
|
+
* Licensed under the MIT License.
|
|
7136
|
+
*/
|
|
7137
|
+
async function getClientAssertion(clientAssertion, clientId, tokenEndpoint) {
|
|
7138
|
+
if (typeof clientAssertion === "string") {
|
|
7139
|
+
return clientAssertion;
|
|
7140
|
+
}
|
|
7141
|
+
else {
|
|
7142
|
+
const config = {
|
|
7143
|
+
clientId: clientId,
|
|
7144
|
+
tokenEndpoint: tokenEndpoint,
|
|
7145
|
+
};
|
|
7146
|
+
return clientAssertion(config);
|
|
7147
|
+
}
|
|
7148
|
+
}
|
|
7149
|
+
|
|
7150
|
+
var ClientAssertionUtils = /*#__PURE__*/Object.freeze({
|
|
7151
|
+
__proto__: null,
|
|
7152
|
+
getClientAssertion: getClientAssertion
|
|
7153
|
+
});
|
|
7154
|
+
|
|
7042
7155
|
/*
|
|
7043
7156
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
7044
7157
|
* Licensed under the MIT License.
|
|
@@ -7198,7 +7311,7 @@ class AuthorizationCodeClient extends BaseClient {
|
|
|
7198
7311
|
}
|
|
7199
7312
|
if (this.config.clientCredentials.clientAssertion) {
|
|
7200
7313
|
const clientAssertion = this.config.clientCredentials.clientAssertion;
|
|
7201
|
-
parameterBuilder.addClientAssertion(clientAssertion.assertion);
|
|
7314
|
+
parameterBuilder.addClientAssertion(await getClientAssertion(clientAssertion.assertion, this.config.authOptions.clientId, request.resourceRequestUri));
|
|
7202
7315
|
parameterBuilder.addClientAssertionType(clientAssertion.assertionType);
|
|
7203
7316
|
}
|
|
7204
7317
|
parameterBuilder.addGrantType(GrantType.AUTHORIZATION_CODE_GRANT);
|
|
@@ -7322,7 +7435,11 @@ class AuthorizationCodeClient extends BaseClient {
|
|
|
7322
7435
|
}
|
|
7323
7436
|
else if (request.account) {
|
|
7324
7437
|
const accountSid = this.extractAccountSid(request.account);
|
|
7325
|
-
|
|
7438
|
+
let accountLoginHintClaim = this.extractLoginHint(request.account);
|
|
7439
|
+
if (accountLoginHintClaim && request.domainHint) {
|
|
7440
|
+
this.logger.warning(`AuthorizationCodeClient.createAuthCodeUrlQueryString: "domainHint" param is set, skipping opaque "login_hint" claim. Please consider not passing domainHint`);
|
|
7441
|
+
accountLoginHintClaim = null;
|
|
7442
|
+
}
|
|
7326
7443
|
// If login_hint claim is present, use it over sid/username
|
|
7327
7444
|
if (accountLoginHintClaim) {
|
|
7328
7445
|
this.logger.verbose("createAuthCodeUrlQueryString: login_hint claim present on account");
|
|
@@ -7600,7 +7717,7 @@ class RefreshTokenClient extends BaseClient {
|
|
|
7600
7717
|
}
|
|
7601
7718
|
if (this.config.clientCredentials.clientAssertion) {
|
|
7602
7719
|
const clientAssertion = this.config.clientCredentials.clientAssertion;
|
|
7603
|
-
parameterBuilder.addClientAssertion(clientAssertion.assertion);
|
|
7720
|
+
parameterBuilder.addClientAssertion(await getClientAssertion(clientAssertion.assertion, this.config.authOptions.clientId, request.resourceRequestUri));
|
|
7604
7721
|
parameterBuilder.addClientAssertionType(clientAssertion.assertionType);
|
|
7605
7722
|
}
|
|
7606
7723
|
if (request.authenticationScheme === AuthenticationScheme.POP) {
|
|
@@ -8293,6 +8410,14 @@ function addError(error, logger, event, stackMaxSize = 5) {
|
|
|
8293
8410
|
else if (error instanceof AuthError) {
|
|
8294
8411
|
event.errorCode = error.errorCode;
|
|
8295
8412
|
event.subErrorCode = error.subError;
|
|
8413
|
+
if (error instanceof ServerError ||
|
|
8414
|
+
error instanceof InteractionRequiredAuthError) {
|
|
8415
|
+
event.serverErrorNo = error.errorNo;
|
|
8416
|
+
}
|
|
8417
|
+
return;
|
|
8418
|
+
}
|
|
8419
|
+
else if (error instanceof CacheError) {
|
|
8420
|
+
event.errorCode = error.errorCode;
|
|
8296
8421
|
return;
|
|
8297
8422
|
}
|
|
8298
8423
|
else if (event.errorStack?.length) {
|
|
@@ -8571,7 +8696,7 @@ class PerformanceClient {
|
|
|
8571
8696
|
const context = JSON.stringify(endContext(event, this.abbreviations, this.eventStack.get(rootEvent.correlationId), error));
|
|
8572
8697
|
if (isRoot) {
|
|
8573
8698
|
queueInfo = this.getQueueInfo(event.correlationId);
|
|
8574
|
-
this.
|
|
8699
|
+
this.discardMeasurements(rootEvent.correlationId);
|
|
8575
8700
|
}
|
|
8576
8701
|
else {
|
|
8577
8702
|
rootEvent.incompleteSubMeasurements?.delete(event.eventId);
|
|
@@ -8693,21 +8818,13 @@ class PerformanceClient {
|
|
|
8693
8818
|
};
|
|
8694
8819
|
}
|
|
8695
8820
|
/**
|
|
8696
|
-
* Removes measurements for a given correlation id.
|
|
8821
|
+
* Removes measurements and aux data for a given correlation id.
|
|
8697
8822
|
*
|
|
8698
8823
|
* @param {string} correlationId
|
|
8699
8824
|
*/
|
|
8700
8825
|
discardMeasurements(correlationId) {
|
|
8701
8826
|
this.logger.trace("PerformanceClient: Performance measurements discarded", correlationId);
|
|
8702
8827
|
this.eventsByCorrelationId.delete(correlationId);
|
|
8703
|
-
}
|
|
8704
|
-
/**
|
|
8705
|
-
* Removes cache for a given correlation id.
|
|
8706
|
-
*
|
|
8707
|
-
* @param {string} correlationId correlation identifier
|
|
8708
|
-
*/
|
|
8709
|
-
discardCache(correlationId) {
|
|
8710
|
-
this.discardMeasurements(correlationId);
|
|
8711
8828
|
this.logger.trace("PerformanceClient: QueueMeasurements discarded", correlationId);
|
|
8712
8829
|
this.queueMeasurements.delete(correlationId);
|
|
8713
8830
|
this.logger.trace("PerformanceClient: Pre-queue times discarded", correlationId);
|
|
@@ -8795,6 +8912,8 @@ exports.AuthorizationCodeClient = AuthorizationCodeClient;
|
|
|
8795
8912
|
exports.AzureCloudInstance = AzureCloudInstance;
|
|
8796
8913
|
exports.BaseClient = BaseClient;
|
|
8797
8914
|
exports.CacheAccountType = CacheAccountType;
|
|
8915
|
+
exports.CacheError = CacheError;
|
|
8916
|
+
exports.CacheErrorCodes = CacheErrorCodes;
|
|
8798
8917
|
exports.CacheHelpers = CacheHelpers;
|
|
8799
8918
|
exports.CacheManager = CacheManager;
|
|
8800
8919
|
exports.CacheOutcome = CacheOutcome;
|
|
@@ -8802,6 +8921,7 @@ exports.CacheRecord = CacheRecord;
|
|
|
8802
8921
|
exports.CacheType = CacheType;
|
|
8803
8922
|
exports.CcsCredentialType = CcsCredentialType;
|
|
8804
8923
|
exports.ClaimsRequestKeys = ClaimsRequestKeys;
|
|
8924
|
+
exports.ClientAssertionUtils = ClientAssertionUtils;
|
|
8805
8925
|
exports.ClientAuthError = ClientAuthError;
|
|
8806
8926
|
exports.ClientAuthErrorCodes = ClientAuthErrorCodes;
|
|
8807
8927
|
exports.ClientAuthErrorMessage = ClientAuthErrorMessage;
|
|
@@ -8813,6 +8933,7 @@ exports.Constants = Constants;
|
|
|
8813
8933
|
exports.CredentialType = CredentialType;
|
|
8814
8934
|
exports.DEFAULT_CRYPTO_IMPLEMENTATION = DEFAULT_CRYPTO_IMPLEMENTATION;
|
|
8815
8935
|
exports.DEFAULT_SYSTEM_OPTIONS = DEFAULT_SYSTEM_OPTIONS;
|
|
8936
|
+
exports.DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = DEFAULT_TOKEN_RENEWAL_OFFSET_SEC;
|
|
8816
8937
|
exports.DefaultStorageClass = DefaultStorageClass;
|
|
8817
8938
|
exports.Errors = Errors;
|
|
8818
8939
|
exports.GrantType = GrantType;
|
|
@@ -8866,6 +8987,7 @@ exports.createClientAuthError = createClientAuthError;
|
|
|
8866
8987
|
exports.createClientConfigurationError = createClientConfigurationError;
|
|
8867
8988
|
exports.createInteractionRequiredAuthError = createInteractionRequiredAuthError;
|
|
8868
8989
|
exports.formatAuthorityUri = formatAuthorityUri;
|
|
8990
|
+
exports.getClientAssertion = getClientAssertion;
|
|
8869
8991
|
exports.getTenantIdFromIdTokenClaims = getTenantIdFromIdTokenClaims;
|
|
8870
8992
|
exports.invoke = invoke;
|
|
8871
8993
|
exports.invokeAsync = invokeAsync;
|