@azure/msal-common 14.0.3 → 14.1.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.d.ts +0 -1
- package/dist/account/AccountInfo.d.ts.map +1 -1
- package/dist/account/AuthToken.d.ts.map +1 -1
- package/dist/account/AuthToken.mjs +7 -6
- package/dist/account/AuthToken.mjs.map +1 -1
- package/dist/account/CcsCredential.mjs +1 -1
- package/dist/account/ClientInfo.d.ts.map +1 -1
- package/dist/account/ClientInfo.mjs +6 -5
- package/dist/account/ClientInfo.mjs.map +1 -1
- package/dist/authority/Authority.d.ts.map +1 -1
- package/dist/authority/Authority.mjs +28 -50
- package/dist/authority/Authority.mjs.map +1 -1
- package/dist/authority/AuthorityFactory.d.ts.map +1 -1
- package/dist/authority/AuthorityFactory.mjs +9 -7
- package/dist/authority/AuthorityFactory.mjs.map +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.d.ts +3 -1
- package/dist/authority/RegionDiscovery.d.ts.map +1 -1
- package/dist/authority/RegionDiscovery.mjs +7 -8
- package/dist/authority/RegionDiscovery.mjs.map +1 -1
- package/dist/cache/CacheManager.d.ts +25 -7
- package/dist/cache/CacheManager.d.ts.map +1 -1
- package/dist/cache/CacheManager.mjs +98 -71
- package/dist/cache/CacheManager.mjs.map +1 -1
- package/dist/cache/entities/AccessTokenEntity.d.ts.map +1 -1
- package/dist/cache/entities/AccessTokenEntity.mjs +4 -3
- package/dist/cache/entities/AccessTokenEntity.mjs.map +1 -1
- package/dist/cache/entities/AccountEntity.d.ts.map +1 -1
- package/dist/cache/entities/AccountEntity.mjs +4 -3
- package/dist/cache/entities/AccountEntity.mjs.map +1 -1
- package/dist/cache/entities/AppMetadataEntity.mjs +1 -1
- package/dist/cache/entities/AuthorityMetadataEntity.mjs +1 -1
- package/dist/cache/entities/CacheRecord.mjs +1 -1
- package/dist/cache/entities/CredentialEntity.d.ts.map +1 -1
- package/dist/cache/entities/CredentialEntity.mjs +4 -3
- package/dist/cache/entities/CredentialEntity.mjs.map +1 -1
- package/dist/cache/entities/IdTokenEntity.mjs +1 -1
- package/dist/cache/entities/RefreshTokenEntity.mjs +1 -1
- package/dist/cache/entities/ServerTelemetryEntity.mjs +1 -1
- package/dist/cache/entities/ThrottlingEntity.mjs +1 -1
- package/dist/cache/persistence/TokenCacheContext.mjs +1 -1
- package/dist/cache/utils/CacheTypes.d.ts +3 -6
- package/dist/cache/utils/CacheTypes.d.ts.map +1 -1
- package/dist/client/AuthorizationCodeClient.d.ts.map +1 -1
- package/dist/client/AuthorizationCodeClient.mjs +13 -11
- package/dist/client/AuthorizationCodeClient.mjs.map +1 -1
- package/dist/client/BaseClient.d.ts.map +1 -1
- package/dist/client/BaseClient.mjs +5 -4
- package/dist/client/BaseClient.mjs.map +1 -1
- package/dist/client/RefreshTokenClient.d.ts.map +1 -1
- package/dist/client/RefreshTokenClient.mjs +33 -74
- package/dist/client/RefreshTokenClient.mjs.map +1 -1
- package/dist/client/SilentFlowClient.d.ts +2 -1
- package/dist/client/SilentFlowClient.d.ts.map +1 -1
- package/dist/client/SilentFlowClient.mjs +43 -19
- package/dist/client/SilentFlowClient.mjs.map +1 -1
- package/dist/config/ClientConfiguration.d.ts.map +1 -1
- package/dist/config/ClientConfiguration.mjs +5 -6
- package/dist/config/ClientConfiguration.mjs.map +1 -1
- package/dist/crypto/ICrypto.d.ts +0 -4
- package/dist/crypto/ICrypto.d.ts.map +1 -1
- package/dist/crypto/ICrypto.mjs +11 -22
- package/dist/crypto/ICrypto.mjs.map +1 -1
- package/dist/crypto/JoseHeader.d.ts.map +1 -1
- package/dist/crypto/JoseHeader.mjs +5 -4
- package/dist/crypto/JoseHeader.mjs.map +1 -1
- package/dist/crypto/PopTokenGenerator.d.ts +2 -1
- package/dist/crypto/PopTokenGenerator.d.ts.map +1 -1
- package/dist/crypto/PopTokenGenerator.mjs +4 -4
- package/dist/crypto/PopTokenGenerator.mjs.map +1 -1
- package/dist/error/AuthError.d.ts +8 -11
- package/dist/error/AuthError.d.ts.map +1 -1
- package/dist/error/AuthError.mjs +19 -21
- package/dist/error/AuthError.mjs.map +1 -1
- package/dist/error/AuthErrorCodes.d.ts +6 -0
- package/dist/error/AuthErrorCodes.d.ts.map +1 -0
- package/dist/error/AuthErrorCodes.mjs +14 -0
- package/dist/error/AuthErrorCodes.mjs.map +1 -0
- package/dist/error/ClientAuthError.d.ts +54 -234
- package/dist/error/ClientAuthError.d.ts.map +1 -1
- package/dist/error/ClientAuthError.mjs +149 -421
- package/dist/error/ClientAuthError.mjs.map +1 -1
- package/dist/error/ClientAuthErrorCodes.d.ts +44 -0
- package/dist/error/ClientAuthErrorCodes.d.ts.map +1 -0
- package/dist/error/ClientAuthErrorCodes.mjs +52 -0
- package/dist/error/ClientAuthErrorCodes.mjs.map +1 -0
- package/dist/error/ClientConfigurationError.d.ts +31 -125
- package/dist/error/ClientConfigurationError.d.ts.map +1 -1
- package/dist/error/ClientConfigurationError.mjs +81 -222
- package/dist/error/ClientConfigurationError.mjs.map +1 -1
- package/dist/error/ClientConfigurationErrorCodes.d.ts +23 -0
- package/dist/error/ClientConfigurationErrorCodes.d.ts.map +1 -0
- package/dist/error/ClientConfigurationErrorCodes.mjs +31 -0
- package/dist/error/ClientConfigurationErrorCodes.mjs.map +1 -0
- package/dist/error/InteractionRequiredAuthError.d.ts +14 -16
- package/dist/error/InteractionRequiredAuthError.d.ts.map +1 -1
- package/dist/error/InteractionRequiredAuthError.mjs +42 -41
- package/dist/error/InteractionRequiredAuthError.mjs.map +1 -1
- package/dist/error/InteractionRequiredAuthErrorCodes.d.ts +6 -0
- package/dist/error/InteractionRequiredAuthErrorCodes.d.ts.map +1 -0
- package/dist/error/InteractionRequiredAuthErrorCodes.mjs +16 -0
- package/dist/error/InteractionRequiredAuthErrorCodes.mjs.map +1 -0
- package/dist/error/JoseHeaderError.d.ts +7 -20
- package/dist/error/JoseHeaderError.d.ts.map +1 -1
- package/dist/error/JoseHeaderError.mjs +10 -26
- package/dist/error/JoseHeaderError.mjs.map +1 -1
- package/dist/error/JoseHeaderErrorCodes.d.ts +3 -0
- package/dist/error/JoseHeaderErrorCodes.d.ts.map +1 -0
- package/dist/error/JoseHeaderErrorCodes.mjs +11 -0
- package/dist/error/JoseHeaderErrorCodes.mjs.map +1 -0
- package/dist/error/ServerError.mjs +1 -1
- package/dist/index.cjs +942 -1210
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +13 -5
- package/dist/index.mjs.map +1 -1
- package/dist/logger/Logger.mjs +1 -1
- package/dist/network/INetworkModule.d.ts.map +1 -1
- package/dist/network/INetworkModule.mjs +5 -6
- package/dist/network/INetworkModule.mjs.map +1 -1
- package/dist/network/NetworkManager.d.ts.map +1 -1
- package/dist/network/NetworkManager.mjs +4 -3
- package/dist/network/NetworkManager.mjs.map +1 -1
- package/dist/network/ThrottlingUtils.mjs +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/request/AuthenticationHeaderParser.d.ts.map +1 -1
- package/dist/request/AuthenticationHeaderParser.mjs +7 -6
- package/dist/request/AuthenticationHeaderParser.mjs.map +1 -1
- package/dist/request/CommonRefreshTokenRequest.d.ts +3 -0
- package/dist/request/CommonRefreshTokenRequest.d.ts.map +1 -1
- package/dist/request/CommonSilentFlowRequest.d.ts +2 -0
- package/dist/request/CommonSilentFlowRequest.d.ts.map +1 -1
- package/dist/request/RequestParameterBuilder.d.ts.map +1 -1
- package/dist/request/RequestParameterBuilder.mjs +5 -4
- package/dist/request/RequestParameterBuilder.mjs.map +1 -1
- package/dist/request/RequestValidator.d.ts.map +1 -1
- package/dist/request/RequestValidator.mjs +8 -7
- package/dist/request/RequestValidator.mjs.map +1 -1
- package/dist/request/ScopeSet.d.ts.map +1 -1
- package/dist/request/ScopeSet.mjs +10 -8
- package/dist/request/ScopeSet.mjs.map +1 -1
- package/dist/response/ResponseHandler.d.ts.map +1 -1
- package/dist/response/ResponseHandler.mjs +15 -14
- package/dist/response/ResponseHandler.mjs.map +1 -1
- package/dist/telemetry/performance/PerformanceClient.d.ts.map +1 -1
- package/dist/telemetry/performance/PerformanceClient.mjs +3 -2
- package/dist/telemetry/performance/PerformanceClient.mjs.map +1 -1
- package/dist/telemetry/performance/PerformanceEvent.d.ts +8 -0
- package/dist/telemetry/performance/PerformanceEvent.d.ts.map +1 -1
- package/dist/telemetry/performance/PerformanceEvent.mjs +9 -1
- package/dist/telemetry/performance/PerformanceEvent.mjs.map +1 -1
- package/dist/telemetry/performance/StubPerformanceClient.mjs +1 -1
- package/dist/telemetry/server/ServerTelemetryManager.d.ts.map +1 -1
- package/dist/telemetry/server/ServerTelemetryManager.mjs +2 -2
- package/dist/telemetry/server/ServerTelemetryManager.mjs.map +1 -1
- package/dist/url/UrlString.d.ts.map +1 -1
- package/dist/url/UrlString.mjs +13 -11
- package/dist/url/UrlString.mjs.map +1 -1
- package/dist/utils/Constants.d.ts +6 -3
- package/dist/utils/Constants.d.ts.map +1 -1
- package/dist/utils/Constants.mjs +12 -4
- package/dist/utils/Constants.mjs.map +1 -1
- package/dist/utils/FunctionWrappers.d.ts.map +1 -1
- package/dist/utils/FunctionWrappers.mjs +1 -2
- package/dist/utils/FunctionWrappers.mjs.map +1 -1
- package/dist/utils/ProtocolUtils.d.ts.map +1 -1
- package/dist/utils/ProtocolUtils.mjs +7 -6
- package/dist/utils/ProtocolUtils.mjs.map +1 -1
- package/dist/utils/StringUtils.mjs +1 -1
- package/dist/utils/TimeUtils.mjs +1 -1
- package/package.json +1 -1
- package/src/account/AccountInfo.ts +0 -1
- package/src/account/AuthToken.ts +8 -7
- package/src/account/ClientInfo.ts +9 -6
- package/src/authority/Authority.ts +76 -94
- package/src/authority/AuthorityFactory.ts +21 -9
- package/src/authority/RegionDiscovery.ts +21 -18
- package/src/cache/CacheManager.ts +133 -95
- package/src/cache/entities/AccessTokenEntity.ts +7 -2
- package/src/cache/entities/AccountEntity.ts +7 -2
- package/src/cache/entities/CredentialEntity.ts +7 -2
- package/src/cache/utils/CacheTypes.ts +6 -6
- package/src/client/AuthorizationCodeClient.ts +35 -11
- package/src/client/BaseClient.ts +7 -4
- package/src/client/RefreshTokenClient.ts +100 -126
- package/src/client/SilentFlowClient.ts +72 -19
- package/src/config/ClientConfiguration.ts +6 -7
- package/src/crypto/ICrypto.ts +12 -34
- package/src/crypto/JoseHeader.ts +6 -3
- package/src/crypto/PopTokenGenerator.ts +10 -5
- package/src/error/AuthError.ts +24 -26
- package/src/error/AuthErrorCodes.ts +10 -0
- package/src/error/ClientAuthError.ts +227 -632
- package/src/error/ClientAuthErrorCodes.ts +51 -0
- package/src/error/ClientConfigurationError.ts +146 -332
- package/src/error/ClientConfigurationErrorCodes.ts +28 -0
- package/src/error/InteractionRequiredAuthError.ts +60 -55
- package/src/error/InteractionRequiredAuthErrorCodes.ts +13 -0
- package/src/error/JoseHeaderError.ts +11 -31
- package/src/error/JoseHeaderErrorCodes.ts +7 -0
- package/src/index.ts +13 -1
- package/src/network/INetworkModule.ts +10 -7
- package/src/network/NetworkManager.ts +5 -5
- package/src/packageMetadata.ts +1 -1
- package/src/request/AuthenticationHeaderParser.ts +11 -8
- package/src/request/CommonRefreshTokenRequest.ts +3 -0
- package/src/request/CommonSilentFlowRequest.ts +2 -0
- package/src/request/RequestParameterBuilder.ts +10 -3
- package/src/request/RequestValidator.ts +19 -6
- package/src/request/ScopeSet.ts +23 -7
- package/src/response/ResponseHandler.ts +37 -17
- package/src/telemetry/performance/PerformanceClient.ts +2 -1
- package/src/telemetry/performance/PerformanceEvent.ts +9 -0
- package/src/telemetry/server/ServerTelemetryManager.ts +1 -1
- package/src/url/UrlString.ts +26 -16
- package/src/utils/Constants.ts +11 -3
- package/src/utils/FunctionWrappers.ts +0 -1
- package/src/utils/ProtocolUtils.ts +8 -12
|
@@ -9,7 +9,6 @@ import { TokenClaims } from "./TokenClaims";
|
|
|
9
9
|
* - name - Full name for the account, including given name and family name
|
|
10
10
|
* - idToken - raw ID token
|
|
11
11
|
* - idTokenClaims - Object contains claims from ID token
|
|
12
|
-
* - localAccountId - The user's account ID
|
|
13
12
|
* - nativeAccountId - The user's native account ID
|
|
14
13
|
*/
|
|
15
14
|
export type AccountInfo = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountInfo.d.ts","sourceRoot":"","sources":["../../src/account/AccountInfo.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C
|
|
1
|
+
{"version":3,"file":"AccountInfo.d.ts","sourceRoot":"","sources":["../../src/account/AccountInfo.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,WAAW,GAAG;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,WAAW,GAAG;QAC1B,CAAC,GAAG,EAAE,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,EAAE,GACR,MAAM,GACN,SAAS,GACT,OAAO,CAAC;KACjB,CAAC;IACF,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;CAC1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthToken.d.ts","sourceRoot":"","sources":["../../src/account/AuthToken.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"AuthToken.d.ts","sourceRoot":"","sources":["../../src/account/AuthToken.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAM5C;;;;GAIG;AACH,wBAAgB,kBAAkB,CAC9B,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GACxC,WAAW,CAWb;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAkBvD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAUlE"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
/*! @azure/msal-common v14.0
|
|
1
|
+
/*! @azure/msal-common v14.1.0 2023-10-05 */
|
|
2
2
|
'use strict';
|
|
3
|
-
import {
|
|
3
|
+
import { createClientAuthError } from '../error/ClientAuthError.mjs';
|
|
4
|
+
import { tokenParsingError, nullOrEmptyToken, maxAgeTranspired } from '../error/ClientAuthErrorCodes.mjs';
|
|
4
5
|
|
|
5
6
|
/*
|
|
6
7
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -20,7 +21,7 @@ function extractTokenClaims(encodedToken, base64Decode) {
|
|
|
20
21
|
return JSON.parse(base64Decoded);
|
|
21
22
|
}
|
|
22
23
|
catch (err) {
|
|
23
|
-
throw
|
|
24
|
+
throw createClientAuthError(tokenParsingError);
|
|
24
25
|
}
|
|
25
26
|
}
|
|
26
27
|
/**
|
|
@@ -30,12 +31,12 @@ function extractTokenClaims(encodedToken, base64Decode) {
|
|
|
30
31
|
*/
|
|
31
32
|
function getJWSPayload(authToken) {
|
|
32
33
|
if (!authToken) {
|
|
33
|
-
throw
|
|
34
|
+
throw createClientAuthError(nullOrEmptyToken);
|
|
34
35
|
}
|
|
35
36
|
const tokenPartsRegex = /^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/;
|
|
36
37
|
const matches = tokenPartsRegex.exec(authToken);
|
|
37
38
|
if (!matches || matches.length < 4) {
|
|
38
|
-
throw
|
|
39
|
+
throw createClientAuthError(tokenParsingError);
|
|
39
40
|
}
|
|
40
41
|
/**
|
|
41
42
|
* const crackedToken = {
|
|
@@ -57,7 +58,7 @@ function checkMaxAge(authTime, maxAge) {
|
|
|
57
58
|
*/
|
|
58
59
|
const fiveMinuteSkew = 300000; // five minutes in milliseconds
|
|
59
60
|
if (maxAge === 0 || Date.now() - fiveMinuteSkew > authTime + maxAge) {
|
|
60
|
-
throw
|
|
61
|
+
throw createClientAuthError(maxAgeTranspired);
|
|
61
62
|
}
|
|
62
63
|
}
|
|
63
64
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthToken.mjs","sources":["../../src/account/AuthToken.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AuthToken.mjs","sources":["../../src/account/AuthToken.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAKA;AAMA;;;AAIG;AACH;AAgBA;;;;AAIG,IAAA,MAAA,UAAA,GAAA,aAAA,CAAA,YAAA,CAAA,CAAA;AACH;AAoBA,IAAA,IAAA;;AAEG,QAAA,MAAA,aAAA,GAAA,YAAA,CAAA,UAAA,CAAA,CAAA;AACH,QAAgB,OAAA,IAAA,CAAA,KAAA,CAAA,aAAY,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClientInfo.d.ts","sourceRoot":"","sources":["../../src/account/ClientInfo.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ClientInfo.d.ts","sourceRoot":"","sources":["../../src/account/ClientInfo.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAG5C;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,eAAe,CAC3B,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,OAAO,GAChB,UAAU,CAaZ;AAED;;;GAGG;AACH,wBAAgB,gCAAgC,CAC5C,aAAa,EAAE,MAAM,GACtB,UAAU,CAiBZ"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
/*! @azure/msal-common v14.0
|
|
1
|
+
/*! @azure/msal-common v14.1.0 2023-10-05 */
|
|
2
2
|
'use strict';
|
|
3
|
-
import {
|
|
3
|
+
import { createClientAuthError } from '../error/ClientAuthError.mjs';
|
|
4
4
|
import { Separators, Constants } from '../utils/Constants.mjs';
|
|
5
|
+
import { clientInfoEmptyError, clientInfoDecodingError } from '../error/ClientAuthErrorCodes.mjs';
|
|
5
6
|
|
|
6
7
|
/*
|
|
7
8
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -14,14 +15,14 @@ import { Separators, Constants } from '../utils/Constants.mjs';
|
|
|
14
15
|
*/
|
|
15
16
|
function buildClientInfo(rawClientInfo, crypto) {
|
|
16
17
|
if (!rawClientInfo) {
|
|
17
|
-
throw
|
|
18
|
+
throw createClientAuthError(clientInfoEmptyError);
|
|
18
19
|
}
|
|
19
20
|
try {
|
|
20
21
|
const decodedClientInfo = crypto.base64Decode(rawClientInfo);
|
|
21
22
|
return JSON.parse(decodedClientInfo);
|
|
22
23
|
}
|
|
23
24
|
catch (e) {
|
|
24
|
-
throw
|
|
25
|
+
throw createClientAuthError(clientInfoDecodingError);
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
28
|
/**
|
|
@@ -30,7 +31,7 @@ function buildClientInfo(rawClientInfo, crypto) {
|
|
|
30
31
|
*/
|
|
31
32
|
function buildClientInfoFromHomeAccountId(homeAccountId) {
|
|
32
33
|
if (!homeAccountId) {
|
|
33
|
-
throw
|
|
34
|
+
throw createClientAuthError(clientInfoDecodingError);
|
|
34
35
|
}
|
|
35
36
|
const clientInfoParts = homeAccountId.split(Separators.CLIENT_INFO_SEPARATOR, 2);
|
|
36
37
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClientInfo.mjs","sources":["../../src/account/ClientInfo.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ClientInfo.mjs","sources":["../../src/account/ClientInfo.ts"],"sourcesContent":[null],"names":["ClientAuthErrorCodes.clientInfoEmptyError"],"mappings":";;;;;;AASA;AAGA;;AAEG;;;AAMH;;;;AAIG,IAAA,IAAA,CAAA,aAAA,EAAA;AACH,QAAgB,MAAA,qBAAA,CAAAA,oBAEJ,CAAO,CAChB;AAeH,KAAA;;;AAGG,QAAA,OAAA,IAAA,CAAA,KAAA,CAAA,iBAAA,CAAA,CAAA;AACH,KAAA;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Authority.d.ts","sourceRoot":"","sources":["../../src/authority/Authority.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAEH,oBAAoB,EACvB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"Authority.d.ts","sourceRoot":"","sources":["../../src/authority/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|
1
|
-
/*! @azure/msal-common v14.0
|
|
1
|
+
/*! @azure/msal-common v14.1.0 2023-10-05 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { AuthorityType } from './AuthorityType.mjs';
|
|
4
4
|
import { isOpenIdConfigResponse } from './OpenIdConfigResponse.mjs';
|
|
5
5
|
import { UrlString } from '../url/UrlString.mjs';
|
|
6
|
-
import {
|
|
6
|
+
import { createClientAuthError } from '../error/ClientAuthError.mjs';
|
|
7
7
|
import { Constants, AuthorityMetadataSource, RegionDiscoveryOutcomes, AADAuthorityConstants } from '../utils/Constants.mjs';
|
|
8
8
|
import { EndpointMetadata, InstanceDiscoveryMetadata, InstanceDiscoveryMetadataAliases } from './AuthorityMetadata.mjs';
|
|
9
|
-
import {
|
|
9
|
+
import { createClientConfigurationError } from '../error/ClientConfigurationError.mjs';
|
|
10
10
|
import { ProtocolMode } from './ProtocolMode.mjs';
|
|
11
11
|
import { AuthorityMetadataEntity } from '../cache/entities/AuthorityMetadataEntity.mjs';
|
|
12
12
|
import { AzureCloudInstance } from './AuthorityOptions.mjs';
|
|
@@ -15,6 +15,9 @@ import { isCloudInstanceDiscoveryErrorResponse } from './CloudInstanceDiscoveryE
|
|
|
15
15
|
import { RegionDiscovery } from './RegionDiscovery.mjs';
|
|
16
16
|
import { AuthError } from '../error/AuthError.mjs';
|
|
17
17
|
import { PerformanceEvents } from '../telemetry/performance/PerformanceEvent.mjs';
|
|
18
|
+
import { invokeAsync } from '../utils/FunctionWrappers.mjs';
|
|
19
|
+
import { endpointResolutionError, endSessionEndpointNotSupported, openIdConfigError } from '../error/ClientAuthErrorCodes.mjs';
|
|
20
|
+
import { invalidAuthorityMetadata, untrustedAuthority, invalidCloudDiscoveryMetadata } from '../error/ClientConfigurationErrorCodes.mjs';
|
|
18
21
|
|
|
19
22
|
/*
|
|
20
23
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -40,7 +43,7 @@ class Authority {
|
|
|
40
43
|
this.logger = logger;
|
|
41
44
|
this.performanceClient = performanceClient;
|
|
42
45
|
this.correlationId = correlationId;
|
|
43
|
-
this.regionDiscovery = new RegionDiscovery(networkInterface, this.performanceClient, this.correlationId);
|
|
46
|
+
this.regionDiscovery = new RegionDiscovery(networkInterface, this.logger, this.performanceClient, this.correlationId);
|
|
44
47
|
}
|
|
45
48
|
/**
|
|
46
49
|
* Get {@link AuthorityType}
|
|
@@ -123,7 +126,7 @@ class Authority {
|
|
|
123
126
|
return this.replacePath(this.metadata.authorization_endpoint);
|
|
124
127
|
}
|
|
125
128
|
else {
|
|
126
|
-
throw
|
|
129
|
+
throw createClientAuthError(endpointResolutionError);
|
|
127
130
|
}
|
|
128
131
|
}
|
|
129
132
|
/**
|
|
@@ -134,7 +137,7 @@ class Authority {
|
|
|
134
137
|
return this.replacePath(this.metadata.token_endpoint);
|
|
135
138
|
}
|
|
136
139
|
else {
|
|
137
|
-
throw
|
|
140
|
+
throw createClientAuthError(endpointResolutionError);
|
|
138
141
|
}
|
|
139
142
|
}
|
|
140
143
|
get deviceCodeEndpoint() {
|
|
@@ -142,7 +145,7 @@ class Authority {
|
|
|
142
145
|
return this.replacePath(this.metadata.token_endpoint.replace("/token", "/devicecode"));
|
|
143
146
|
}
|
|
144
147
|
else {
|
|
145
|
-
throw
|
|
148
|
+
throw createClientAuthError(endpointResolutionError);
|
|
146
149
|
}
|
|
147
150
|
}
|
|
148
151
|
/**
|
|
@@ -152,12 +155,12 @@ class Authority {
|
|
|
152
155
|
if (this.discoveryComplete()) {
|
|
153
156
|
// ROPC policies may not have end_session_endpoint set
|
|
154
157
|
if (!this.metadata.end_session_endpoint) {
|
|
155
|
-
throw
|
|
158
|
+
throw createClientAuthError(endSessionEndpointNotSupported);
|
|
156
159
|
}
|
|
157
160
|
return this.replacePath(this.metadata.end_session_endpoint);
|
|
158
161
|
}
|
|
159
162
|
else {
|
|
160
|
-
throw
|
|
163
|
+
throw createClientAuthError(endpointResolutionError);
|
|
161
164
|
}
|
|
162
165
|
}
|
|
163
166
|
/**
|
|
@@ -168,7 +171,7 @@ class Authority {
|
|
|
168
171
|
return this.replacePath(this.metadata.issuer);
|
|
169
172
|
}
|
|
170
173
|
else {
|
|
171
|
-
throw
|
|
174
|
+
throw createClientAuthError(endpointResolutionError);
|
|
172
175
|
}
|
|
173
176
|
}
|
|
174
177
|
/**
|
|
@@ -179,7 +182,7 @@ class Authority {
|
|
|
179
182
|
return this.replacePath(this.metadata.jwks_uri);
|
|
180
183
|
}
|
|
181
184
|
else {
|
|
182
|
-
throw
|
|
185
|
+
throw createClientAuthError(endpointResolutionError);
|
|
183
186
|
}
|
|
184
187
|
}
|
|
185
188
|
/**
|
|
@@ -236,7 +239,8 @@ class Authority {
|
|
|
236
239
|
*/
|
|
237
240
|
get defaultOpenIdConfigurationEndpoint() {
|
|
238
241
|
const canonicalAuthorityHost = this.hostnameAndPort;
|
|
239
|
-
if (this.
|
|
242
|
+
if (this.canonicalAuthority.endsWith("v2.0/") ||
|
|
243
|
+
this.authorityType === AuthorityType.Adfs ||
|
|
240
244
|
(this.protocolMode !== ProtocolMode.AAD &&
|
|
241
245
|
!this.isAliasOfKnownMicrosoftAuthority(canonicalAuthorityHost))) {
|
|
242
246
|
return `${this.canonicalAuthority}.well-known/openid-configuration`;
|
|
@@ -260,11 +264,9 @@ class Authority {
|
|
|
260
264
|
metadataEntity = new AuthorityMetadataEntity();
|
|
261
265
|
metadataEntity.updateCanonicalAuthority(this.canonicalAuthority);
|
|
262
266
|
}
|
|
263
|
-
this.
|
|
264
|
-
const cloudDiscoverySource = await this.updateCloudDiscoveryMetadata(metadataEntity);
|
|
267
|
+
const cloudDiscoverySource = await invokeAsync(this.updateCloudDiscoveryMetadata.bind(this), PerformanceEvents.AuthorityUpdateCloudDiscoveryMetadata, this.logger, this.performanceClient, this.correlationId)(metadataEntity);
|
|
265
268
|
this.canonicalAuthority = this.canonicalAuthority.replace(this.hostnameAndPort, metadataEntity.preferred_network);
|
|
266
|
-
this.
|
|
267
|
-
const endpointSource = await this.updateEndpointMetadata(metadataEntity);
|
|
269
|
+
const endpointSource = await invokeAsync(this.updateEndpointMetadata.bind(this), PerformanceEvents.AuthorityUpdateEndpointMetadata, this.logger, this.performanceClient, this.correlationId)(metadataEntity);
|
|
268
270
|
if (cloudDiscoverySource !== AuthorityMetadataSource.CACHE &&
|
|
269
271
|
endpointSource !== AuthorityMetadataSource.CACHE) {
|
|
270
272
|
// Reset the expiration time unless both values came from a successful cache lookup
|
|
@@ -299,10 +301,7 @@ class Authority {
|
|
|
299
301
|
this.logger.verbose("Found endpoint metadata from hardcoded values.");
|
|
300
302
|
// If the user prefers to use an azure region replace the global endpoints with regional information.
|
|
301
303
|
if (this.authorityOptions.azureRegionConfiguration?.azureRegion) {
|
|
302
|
-
this.
|
|
303
|
-
this.logger.verbose("Found azure region configuration. Updating endpoints with regional information.");
|
|
304
|
-
hardcodedMetadata =
|
|
305
|
-
await this.updateMetadataWithRegionalInformation(hardcodedMetadata);
|
|
304
|
+
hardcodedMetadata = await invokeAsync(this.updateMetadataWithRegionalInformation.bind(this), PerformanceEvents.AuthorityUpdateMetadataWithRegionalInformation, this.logger, this.performanceClient, this.correlationId)(hardcodedMetadata);
|
|
306
305
|
}
|
|
307
306
|
metadataEntity.updateEndpointMetadata(hardcodedMetadata, false);
|
|
308
307
|
return AuthorityMetadataSource.HARDCODED_VALUES;
|
|
@@ -323,24 +322,18 @@ class Authority {
|
|
|
323
322
|
else if (metadataEntityExpired) {
|
|
324
323
|
this.logger.verbose("The metadata entity is expired.");
|
|
325
324
|
}
|
|
326
|
-
this.
|
|
327
|
-
this.performanceClient?.setPreQueueTime(PerformanceEvents.AuthorityGetEndpointMetadataFromNetwork, this.correlationId);
|
|
328
|
-
metadata = await this.getEndpointMetadataFromNetwork();
|
|
325
|
+
metadata = await invokeAsync(this.getEndpointMetadataFromNetwork.bind(this), PerformanceEvents.AuthorityGetEndpointMetadataFromNetwork, this.logger, this.performanceClient, this.correlationId)();
|
|
329
326
|
if (metadata) {
|
|
330
|
-
this.logger.verbose("Endpoint metadata was successfully returned from getEndpointMetadataFromNetwork()");
|
|
331
327
|
// If the user prefers to use an azure region replace the global endpoints with regional information.
|
|
332
328
|
if (this.authorityOptions.azureRegionConfiguration?.azureRegion) {
|
|
333
|
-
this.
|
|
334
|
-
this.logger.verbose("Found azure region configuration. Updating endpoints with regional information.");
|
|
335
|
-
metadata = await this.updateMetadataWithRegionalInformation(metadata);
|
|
329
|
+
metadata = await invokeAsync(this.updateMetadataWithRegionalInformation.bind(this), PerformanceEvents.AuthorityUpdateMetadataWithRegionalInformation, this.logger, this.performanceClient, this.correlationId)(metadata);
|
|
336
330
|
}
|
|
337
331
|
metadataEntity.updateEndpointMetadata(metadata, true);
|
|
338
332
|
return AuthorityMetadataSource.NETWORK;
|
|
339
333
|
}
|
|
340
334
|
else {
|
|
341
335
|
// Metadata could not be obtained from the config, cache, network or hardcoded values
|
|
342
|
-
|
|
343
|
-
throw ClientAuthError.createUnableToGetOpenidConfigError(this.defaultOpenIdConfigurationEndpoint);
|
|
336
|
+
throw createClientAuthError(openIdConfigError, this.defaultOpenIdConfigurationEndpoint);
|
|
344
337
|
}
|
|
345
338
|
}
|
|
346
339
|
/**
|
|
@@ -364,7 +357,7 @@ class Authority {
|
|
|
364
357
|
return JSON.parse(this.authorityOptions.authorityMetadata);
|
|
365
358
|
}
|
|
366
359
|
catch (e) {
|
|
367
|
-
throw
|
|
360
|
+
throw createClientConfigurationError(invalidAuthorityMetadata);
|
|
368
361
|
}
|
|
369
362
|
}
|
|
370
363
|
return null;
|
|
@@ -376,7 +369,6 @@ class Authority {
|
|
|
376
369
|
*/
|
|
377
370
|
async getEndpointMetadataFromNetwork() {
|
|
378
371
|
this.performanceClient?.addQueueMeasurement(PerformanceEvents.AuthorityGetEndpointMetadataFromNetwork, this.correlationId);
|
|
379
|
-
const perfEvent = this.performanceClient?.startMeasurement(PerformanceEvents.AuthorityGetEndpointMetadataFromNetwork, this.correlationId);
|
|
380
372
|
const options = {};
|
|
381
373
|
/*
|
|
382
374
|
* TODO: Add a timeout if the authority exists in our library's
|
|
@@ -388,23 +380,14 @@ class Authority {
|
|
|
388
380
|
const response = await this.networkInterface.sendGetRequestAsync(openIdConfigurationEndpoint, options);
|
|
389
381
|
const isValidResponse = isOpenIdConfigResponse(response.body);
|
|
390
382
|
if (isValidResponse) {
|
|
391
|
-
perfEvent?.end({ success: true });
|
|
392
383
|
return response.body;
|
|
393
384
|
}
|
|
394
385
|
else {
|
|
395
|
-
perfEvent?.end({
|
|
396
|
-
success: false,
|
|
397
|
-
errorCode: "invalid_response",
|
|
398
|
-
});
|
|
399
386
|
this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: could not parse response as OpenID configuration`);
|
|
400
387
|
return null;
|
|
401
388
|
}
|
|
402
389
|
}
|
|
403
390
|
catch (e) {
|
|
404
|
-
perfEvent?.end({
|
|
405
|
-
success: false,
|
|
406
|
-
errorCode: "request_failure",
|
|
407
|
-
});
|
|
408
391
|
this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: ${e}`);
|
|
409
392
|
return null;
|
|
410
393
|
}
|
|
@@ -434,8 +417,7 @@ class Authority {
|
|
|
434
417
|
userConfiguredAzureRegion;
|
|
435
418
|
return Authority.replaceWithRegionalInformation(metadata, userConfiguredAzureRegion);
|
|
436
419
|
}
|
|
437
|
-
this.
|
|
438
|
-
const autodetectedRegionName = await this.regionDiscovery.detectRegion(this.authorityOptions.azureRegionConfiguration
|
|
420
|
+
const autodetectedRegionName = await invokeAsync(this.regionDiscovery.detectRegion.bind(this.regionDiscovery), PerformanceEvents.RegionDiscoveryDetectRegion, this.logger, this.performanceClient, this.correlationId)(this.authorityOptions.azureRegionConfiguration
|
|
439
421
|
?.environmentRegion, this.regionDiscoveryMetadata);
|
|
440
422
|
if (autodetectedRegionName) {
|
|
441
423
|
this.regionDiscoveryMetadata.region_outcome =
|
|
@@ -494,17 +476,13 @@ class Authority {
|
|
|
494
476
|
else if (metadataEntityExpired) {
|
|
495
477
|
this.logger.verbose("The metadata entity is expired.");
|
|
496
478
|
}
|
|
497
|
-
this.
|
|
498
|
-
this.performanceClient?.setPreQueueTime(PerformanceEvents.AuthorityGetCloudDiscoveryMetadataFromNetwork, this.correlationId);
|
|
499
|
-
metadata = await this.getCloudDiscoveryMetadataFromNetwork();
|
|
479
|
+
metadata = await invokeAsync(this.getCloudDiscoveryMetadataFromNetwork.bind(this), PerformanceEvents.AuthorityGetCloudDiscoveryMetadataFromNetwork, this.logger, this.performanceClient, this.correlationId)();
|
|
500
480
|
if (metadata) {
|
|
501
|
-
this.logger.verbose("cloud discovery metadata was successfully returned from getCloudDiscoveryMetadataFromNetwork()");
|
|
502
481
|
metadataEntity.updateCloudDiscoveryMetadata(metadata, true);
|
|
503
482
|
return AuthorityMetadataSource.NETWORK;
|
|
504
483
|
}
|
|
505
484
|
// Metadata could not be obtained from the config, cache, network or hardcoded values
|
|
506
|
-
|
|
507
|
-
throw ClientConfigurationError.createUntrustedAuthorityError();
|
|
485
|
+
throw createClientConfigurationError(untrustedAuthority);
|
|
508
486
|
}
|
|
509
487
|
/**
|
|
510
488
|
* Parse cloudDiscoveryMetadata config or check knownAuthorities
|
|
@@ -533,7 +511,7 @@ class Authority {
|
|
|
533
511
|
}
|
|
534
512
|
catch (e) {
|
|
535
513
|
this.logger.verbose("Unable to parse the cloud discovery metadata. Throwing Invalid Cloud Discovery Metadata Error.");
|
|
536
|
-
throw
|
|
514
|
+
throw createClientConfigurationError(invalidCloudDiscoveryMetadata);
|
|
537
515
|
}
|
|
538
516
|
}
|
|
539
517
|
// If cloudDiscoveryMetadata is empty or does not contain the host, check knownAuthorities
|
|
@@ -677,7 +655,7 @@ class Authority {
|
|
|
677
655
|
return this.metadata.preferred_cache;
|
|
678
656
|
}
|
|
679
657
|
else {
|
|
680
|
-
throw
|
|
658
|
+
throw createClientAuthError(endpointResolutionError);
|
|
681
659
|
}
|
|
682
660
|
}
|
|
683
661
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Authority.mjs","sources":["../../src/authority/Authority.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Authority.mjs","sources":["../../src/authority/Authority.ts"],"sourcesContent":[null],"names":["ClientAuthErrorCodes.endpointResolutionError","ClientAuthErrorCodes.endSessionEndpointNotSupported"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAKA;AACA;AAKA;AAKA;AAkDI;AAEA;;;;AAQ8B,MAAA,SAAA,CAAA;IAE9B,qBAAuB,EAAA,gBAAA,EAAA,YAAA,EAAA,gBAAA,EAAA,MAAA,EAAA,iBAAA,EAAA,aAAA,EAAA;AAEvB,QAAA,IAAA,CAAS,kBAAkB,GAAoB,SAAA,CAAA;AAE/C,QAAA,IAAA,CAAS,mBAAsB,CAAA,eAAa,CAAA;AAE5C,QAAA,IAAQ,CAAA,gBAAO,GAAA,gBAMZ,CAAA;yBAGU,GAAQ,YACD,CAAA;AA4BpB,QAAA,IAAA,CAAA,gBAAA,GAAA,gBAAA,CAAA;;;;AAIG,YAAA,cAAA,EAAA,SAAA;AACH,SAAA,CAAA;QAqBW,IAAA,CAAA,MAAA,GAAiB,MAAA,CAAA;AAI5B,QAAA,IAAA,CAAA,iBAAA,GAAA,iBAAA,CAAA;;AAEG,QAAA,IAAA,CAAA,eAAA,GAAA,IAAA,eAAA,CAAA,gBAAA,EAAA,IAAA,CAAA,MAAA,EAAA,IAAA,CAAA,iBAAA,EAAA,IAAA,CAAA,aAAA,CAAA,CAAA;KACQ;AAIX;;AAEG;;AAKH;;AAEG;QACQ,IAAA,YAAA,CAAA,eAEV,CAAA,QAAA,CAAA,SAAA,CAAA,aAAA,CAAA,EAAA;AAED,YAAA,OAAA,aAAA,CAAA,IAAA,CAAA;;AAEG,QAAA,MAAA,YAAA,GAAA,YAAA,CAAA,YAAA,CAAA;AACH,QAAW,IAAkB,YAAA,CAAA,MAAI;AAMjC,YAAA,QAAA,YAAA,CAAA,CAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthorityFactory.d.ts","sourceRoot":"","sources":["../../src/authority/AuthorityFactory.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"AuthorityFactory.d.ts","sourceRoot":"","sources":["../../src/authority/AuthorityFactory.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAKxC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAK3D,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AAIjF,gBAAgB;AAChB,qBAAa,gBAAgB;IACzB;;;;;;;;;OASG;WACU,wBAAwB,CACjC,YAAY,EAAE,MAAM,EACpB,aAAa,EAAE,cAAc,EAC7B,YAAY,EAAE,aAAa,EAC3B,gBAAgB,EAAE,gBAAgB,EAClC,MAAM,EAAE,MAAM,EACd,iBAAiB,CAAC,EAAE,kBAAkB,EACtC,aAAa,CAAC,EAAE,MAAM,GACvB,OAAO,CAAC,SAAS,CAAC;IAuCrB;;;;;;;;;OASG;IACH,MAAM,CAAC,cAAc,CACjB,YAAY,EAAE,MAAM,EACpB,gBAAgB,EAAE,cAAc,EAChC,YAAY,EAAE,aAAa,EAC3B,gBAAgB,EAAE,gBAAgB,EAClC,MAAM,EAAE,MAAM,EACd,iBAAiB,CAAC,EAAE,kBAAkB,EACtC,aAAa,CAAC,EAAE,MAAM,GACvB,SAAS;CAkBf"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
/*! @azure/msal-common v14.0
|
|
1
|
+
/*! @azure/msal-common v14.1.0 2023-10-05 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { Authority } from './Authority.mjs';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { createClientConfigurationError } from '../error/ClientConfigurationError.mjs';
|
|
5
|
+
import { createClientAuthError } from '../error/ClientAuthError.mjs';
|
|
6
6
|
import { PerformanceEvents } from '../telemetry/performance/PerformanceEvent.mjs';
|
|
7
|
+
import { invokeAsync } from '../utils/FunctionWrappers.mjs';
|
|
8
|
+
import { endpointResolutionError } from '../error/ClientAuthErrorCodes.mjs';
|
|
9
|
+
import { urlEmptyError } from '../error/ClientConfigurationErrorCodes.mjs';
|
|
7
10
|
|
|
8
11
|
/*
|
|
9
12
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -27,12 +30,11 @@ class AuthorityFactory {
|
|
|
27
30
|
// Initialize authority and perform discovery endpoint check.
|
|
28
31
|
const acquireTokenAuthority = AuthorityFactory.createInstance(authorityUriFinal, networkClient, cacheManager, authorityOptions, logger, performanceClient, correlationId);
|
|
29
32
|
try {
|
|
30
|
-
|
|
31
|
-
await acquireTokenAuthority.resolveEndpointsAsync();
|
|
33
|
+
await invokeAsync(acquireTokenAuthority.resolveEndpointsAsync.bind(acquireTokenAuthority), PerformanceEvents.AuthorityResolveEndpointsAsync, logger, performanceClient, correlationId)();
|
|
32
34
|
return acquireTokenAuthority;
|
|
33
35
|
}
|
|
34
36
|
catch (e) {
|
|
35
|
-
throw
|
|
37
|
+
throw createClientAuthError(endpointResolutionError);
|
|
36
38
|
}
|
|
37
39
|
}
|
|
38
40
|
/**
|
|
@@ -48,7 +50,7 @@ class AuthorityFactory {
|
|
|
48
50
|
static createInstance(authorityUrl, networkInterface, cacheManager, authorityOptions, logger, performanceClient, correlationId) {
|
|
49
51
|
// Throw error if authority url is empty
|
|
50
52
|
if (!authorityUrl) {
|
|
51
|
-
throw
|
|
53
|
+
throw createClientConfigurationError(urlEmptyError);
|
|
52
54
|
}
|
|
53
55
|
return new Authority(authorityUrl, networkInterface, cacheManager, authorityOptions, logger, performanceClient, correlationId);
|
|
54
56
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthorityFactory.mjs","sources":["../../src/authority/AuthorityFactory.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AuthorityFactory.mjs","sources":["../../src/authority/AuthorityFactory.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;AAKA;AAKA;AAKA;AACA;;;;;;;;;AAiBO;AACU;AA+Cb;;;;;;;;;AASG,YAAA,OAAA,qBAAA,CAAA;AACH,SAAA;AA0BH,QAAA,OAAA,CAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -2,12 +2,14 @@ import { INetworkModule } from "../network/INetworkModule";
|
|
|
2
2
|
import { RegionDiscoveryMetadata } from "./RegionDiscoveryMetadata";
|
|
3
3
|
import { ImdsOptions } from "./ImdsOptions";
|
|
4
4
|
import { IPerformanceClient } from "../telemetry/performance/IPerformanceClient";
|
|
5
|
+
import { Logger } from "../logger/Logger";
|
|
5
6
|
export declare class RegionDiscovery {
|
|
6
7
|
protected networkInterface: INetworkModule;
|
|
8
|
+
private logger;
|
|
7
9
|
protected performanceClient: IPerformanceClient | undefined;
|
|
8
10
|
protected correlationId: string | undefined;
|
|
9
11
|
protected static IMDS_OPTIONS: ImdsOptions;
|
|
10
|
-
constructor(networkInterface: INetworkModule, performanceClient?: IPerformanceClient, correlationId?: string);
|
|
12
|
+
constructor(networkInterface: INetworkModule, logger: Logger, performanceClient?: IPerformanceClient, correlationId?: string);
|
|
11
13
|
/**
|
|
12
14
|
* Detect the region from the application's environment.
|
|
13
15
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RegionDiscovery.d.ts","sourceRoot":"","sources":["../../src/authority/RegionDiscovery.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAQ3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AAGjF,qBAAa,eAAe;IAExB,SAAS,CAAC,gBAAgB,EAAE,cAAc,CAAC;IAE3C,SAAS,CAAC,iBAAiB,EAAE,kBAAkB,GAAG,SAAS,CAAC;IAE5D,SAAS,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAE5C,SAAS,CAAC,MAAM,CAAC,YAAY,EAAE,WAAW,CAIxC;gBAGE,gBAAgB,EAAE,cAAc,EAChC,iBAAiB,CAAC,EAAE,kBAAkB,EACtC,aAAa,CAAC,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"RegionDiscovery.d.ts","sourceRoot":"","sources":["../../src/authority/RegionDiscovery.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAQ3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AAGjF,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,qBAAa,eAAe;IAExB,SAAS,CAAC,gBAAgB,EAAE,cAAc,CAAC;IAE3C,OAAO,CAAC,MAAM,CAAS;IAEvB,SAAS,CAAC,iBAAiB,EAAE,kBAAkB,GAAG,SAAS,CAAC;IAE5D,SAAS,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAE5C,SAAS,CAAC,MAAM,CAAC,YAAY,EAAE,WAAW,CAIxC;gBAGE,gBAAgB,EAAE,cAAc,EAChC,MAAM,EAAE,MAAM,EACd,iBAAiB,CAAC,EAAE,kBAAkB,EACtC,aAAa,CAAC,EAAE,MAAM;IAQ1B;;;;OAIG;IACU,YAAY,CACrB,iBAAiB,EAAE,MAAM,GAAG,SAAS,EACrC,uBAAuB,EAAE,uBAAuB,GACjD,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAoFzB;;;;;OAKG;YACW,iBAAiB;IAe/B;;;;OAIG;YACW,iBAAiB;CA6BlC"}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
/*! @azure/msal-common v14.0
|
|
1
|
+
/*! @azure/msal-common v14.1.0 2023-10-05 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { Constants, ResponseCodes, RegionDiscoverySources } from '../utils/Constants.mjs';
|
|
4
4
|
import { PerformanceEvents } from '../telemetry/performance/PerformanceEvent.mjs';
|
|
5
|
+
import { invokeAsync } from '../utils/FunctionWrappers.mjs';
|
|
5
6
|
|
|
6
7
|
/*
|
|
7
8
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
8
9
|
* Licensed under the MIT License.
|
|
9
10
|
*/
|
|
10
11
|
class RegionDiscovery {
|
|
11
|
-
constructor(networkInterface, performanceClient, correlationId) {
|
|
12
|
+
constructor(networkInterface, logger, performanceClient, correlationId) {
|
|
12
13
|
this.networkInterface = networkInterface;
|
|
14
|
+
this.logger = logger;
|
|
13
15
|
this.performanceClient = performanceClient;
|
|
14
16
|
this.correlationId = correlationId;
|
|
15
17
|
}
|
|
@@ -26,8 +28,7 @@ class RegionDiscovery {
|
|
|
26
28
|
if (!autodetectedRegionName) {
|
|
27
29
|
const options = RegionDiscovery.IMDS_OPTIONS;
|
|
28
30
|
try {
|
|
29
|
-
this.
|
|
30
|
-
const localIMDSVersionResponse = await this.getRegionFromIMDS(Constants.IMDS_VERSION, options);
|
|
31
|
+
const localIMDSVersionResponse = await invokeAsync(this.getRegionFromIMDS.bind(this), PerformanceEvents.RegionDiscoveryGetRegionFromIMDS, this.logger, this.performanceClient, this.correlationId)(Constants.IMDS_VERSION, options);
|
|
31
32
|
if (localIMDSVersionResponse.status ===
|
|
32
33
|
ResponseCodes.httpSuccess) {
|
|
33
34
|
autodetectedRegionName = localIMDSVersionResponse.body;
|
|
@@ -37,15 +38,13 @@ class RegionDiscovery {
|
|
|
37
38
|
// If the response using the local IMDS version failed, try to fetch the current version of IMDS and retry.
|
|
38
39
|
if (localIMDSVersionResponse.status ===
|
|
39
40
|
ResponseCodes.httpBadRequest) {
|
|
40
|
-
this.
|
|
41
|
-
const currentIMDSVersion = await this.getCurrentVersion(options);
|
|
41
|
+
const currentIMDSVersion = await invokeAsync(this.getCurrentVersion.bind(this), PerformanceEvents.RegionDiscoveryGetCurrentVersion, this.logger, this.performanceClient, this.correlationId)(options);
|
|
42
42
|
if (!currentIMDSVersion) {
|
|
43
43
|
regionDiscoveryMetadata.region_source =
|
|
44
44
|
RegionDiscoverySources.FAILED_AUTO_DETECTION;
|
|
45
45
|
return null;
|
|
46
46
|
}
|
|
47
|
-
this.
|
|
48
|
-
const currentIMDSVersionResponse = await this.getRegionFromIMDS(currentIMDSVersion, options);
|
|
47
|
+
const currentIMDSVersionResponse = await invokeAsync(this.getRegionFromIMDS.bind(this), PerformanceEvents.RegionDiscoveryGetRegionFromIMDS, this.logger, this.performanceClient, this.correlationId)(currentIMDSVersion, options);
|
|
49
48
|
if (currentIMDSVersionResponse.status ===
|
|
50
49
|
ResponseCodes.httpSuccess) {
|
|
51
50
|
autodetectedRegionName =
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RegionDiscovery.mjs","sources":["../../src/authority/RegionDiscovery.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RegionDiscovery.mjs","sources":["../../src/authority/RegionDiscovery.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;AAKA;AAQA;AACA;AACA;AASW,qBAAgB,CAAA;AAEvB,IAAA,WAA2B,CAAA,gBAAA,EAAoB,MAAA,EAAA,gCAAa,EAAA;AAE5D,QAAA,IAAA,CAAS,gBAAgB,GAAM,gBAAa,CAAA;AAE5C,QAAA,IAAA,CAAS,MAAO,GAAa,MAAA,CAAA;AAOzB,QAAA,IAAA,CAAA,iBAAA,GAAkB,iBAClB,CAAA;AAUJ,QAAA,IAAA,CAAA,aAAA,GAAA,aAAA,CAAA;;;;AAIG;AACU;AAuFb;;;;;AAKG;YACW,CAAiB,sBAAA,EAAA;AAe/B,YAAA,MAAA,OAAA,GAAA,eAAA,CAAA,YAAA,CAAA;;;;AAIG,oBAAA,aAAA,CAAA,WAAA,EAAA;oBAC4B,sBAAA,GAAA,wBAAA,CAAA,IAAA,CAAA;AA6BlC,oBAAA,uBAAA,CAAA,aAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|