@azure/msal-common 12.1.0 → 14.0.0-alpha.1
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/LICENSE +21 -21
- package/README.md +62 -62
- package/dist/account/AccountInfo.d.ts +2 -2
- package/dist/account/AccountInfo.d.ts.map +1 -1
- package/dist/account/AuthToken.d.ts.map +1 -1
- package/dist/account/AuthToken.js +13 -14
- package/dist/account/AuthToken.js.map +1 -1
- package/dist/account/CcsCredential.d.ts +1 -1
- package/dist/account/CcsCredential.d.ts.map +1 -1
- package/dist/account/CcsCredential.js +1 -1
- package/dist/account/CcsCredential.js.map +1 -1
- package/dist/account/ClientCredentials.d.ts +2 -2
- package/dist/account/ClientCredentials.d.ts.map +1 -1
- package/dist/account/ClientInfo.d.ts +1 -1
- package/dist/account/ClientInfo.d.ts.map +1 -1
- package/dist/account/ClientInfo.js +6 -4
- package/dist/account/ClientInfo.js.map +1 -1
- package/dist/account/DecodedAuthToken.d.ts.map +1 -1
- package/dist/account/TokenClaims.d.ts +1 -1
- package/dist/account/TokenClaims.d.ts.map +1 -1
- package/dist/authority/Authority.d.ts.map +1 -1
- package/dist/authority/Authority.js +464 -546
- package/dist/authority/Authority.js.map +1 -1
- package/dist/authority/AuthorityFactory.d.ts.map +1 -1
- package/dist/authority/AuthorityFactory.js +19 -34
- package/dist/authority/AuthorityFactory.js.map +1 -1
- package/dist/authority/AuthorityMetadata.d.ts.map +1 -1
- package/dist/authority/AuthorityMetadata.js +873 -4
- package/dist/authority/AuthorityMetadata.js.map +1 -1
- package/dist/authority/AuthorityOptions.d.ts +1 -1
- package/dist/authority/AuthorityOptions.d.ts.map +1 -1
- package/dist/authority/AuthorityOptions.js +1 -1
- package/dist/authority/AuthorityOptions.js.map +1 -1
- package/dist/authority/AuthorityType.js +1 -1
- package/dist/authority/AuthorityType.js.map +1 -1
- package/dist/authority/AzureRegion.d.ts +1 -1
- package/dist/authority/AzureRegion.d.ts.map +1 -1
- package/dist/authority/AzureRegionConfiguration.d.ts +1 -1
- package/dist/authority/AzureRegionConfiguration.d.ts.map +1 -1
- package/dist/authority/CloudDiscoveryMetadata.d.ts +1 -1
- package/dist/authority/CloudDiscoveryMetadata.d.ts.map +1 -1
- package/dist/authority/CloudInstanceDiscoveryErrorResponse.d.ts +1 -1
- package/dist/authority/CloudInstanceDiscoveryErrorResponse.d.ts.map +1 -1
- package/dist/authority/CloudInstanceDiscoveryErrorResponse.js +1 -1
- package/dist/authority/CloudInstanceDiscoveryErrorResponse.js.map +1 -1
- package/dist/authority/CloudInstanceDiscoveryResponse.d.ts +1 -1
- package/dist/authority/CloudInstanceDiscoveryResponse.d.ts.map +1 -1
- package/dist/authority/CloudInstanceDiscoveryResponse.js +1 -1
- package/dist/authority/CloudInstanceDiscoveryResponse.js.map +1 -1
- package/dist/authority/ImdsOptions.d.ts +1 -1
- package/dist/authority/ImdsOptions.d.ts.map +1 -1
- package/dist/authority/OpenIdConfigResponse.d.ts +1 -1
- package/dist/authority/OpenIdConfigResponse.d.ts.map +1 -1
- package/dist/authority/OpenIdConfigResponse.js +1 -1
- package/dist/authority/OpenIdConfigResponse.js.map +1 -1
- package/dist/authority/ProtocolMode.js +1 -1
- package/dist/authority/ProtocolMode.js.map +1 -1
- package/dist/authority/RegionDiscovery.d.ts.map +1 -1
- package/dist/authority/RegionDiscovery.js +85 -107
- package/dist/authority/RegionDiscovery.js.map +1 -1
- package/dist/authority/RegionDiscoveryMetadata.d.ts +1 -1
- package/dist/authority/RegionDiscoveryMetadata.d.ts.map +1 -1
- package/dist/broker/nativeBroker/INativeBrokerPlugin.d.ts.map +1 -1
- package/dist/cache/CacheManager.d.ts.map +1 -1
- package/dist/cache/CacheManager.js +440 -475
- package/dist/cache/CacheManager.js.map +1 -1
- package/dist/cache/entities/AccessTokenEntity.d.ts.map +1 -1
- package/dist/cache/entities/AccessTokenEntity.js +21 -22
- package/dist/cache/entities/AccessTokenEntity.js.map +1 -1
- package/dist/cache/entities/AccountEntity.d.ts.map +1 -1
- package/dist/cache/entities/AccountEntity.js +78 -66
- package/dist/cache/entities/AccountEntity.js.map +1 -1
- package/dist/cache/entities/AppMetadataEntity.d.ts.map +1 -1
- package/dist/cache/entities/AppMetadataEntity.js +16 -17
- package/dist/cache/entities/AppMetadataEntity.js.map +1 -1
- package/dist/cache/entities/AuthorityMetadataEntity.d.ts.map +1 -1
- package/dist/cache/entities/AuthorityMetadataEntity.js +22 -19
- package/dist/cache/entities/AuthorityMetadataEntity.js.map +1 -1
- package/dist/cache/entities/CacheRecord.d.ts.map +1 -1
- package/dist/cache/entities/CacheRecord.js +4 -5
- package/dist/cache/entities/CacheRecord.js.map +1 -1
- package/dist/cache/entities/CredentialEntity.d.ts.map +1 -1
- package/dist/cache/entities/CredentialEntity.js +35 -34
- package/dist/cache/entities/CredentialEntity.js.map +1 -1
- package/dist/cache/entities/IdTokenEntity.d.ts.map +1 -1
- package/dist/cache/entities/IdTokenEntity.js +8 -14
- package/dist/cache/entities/IdTokenEntity.js.map +1 -1
- package/dist/cache/entities/RefreshTokenEntity.d.ts.map +1 -1
- package/dist/cache/entities/RefreshTokenEntity.js +8 -14
- package/dist/cache/entities/RefreshTokenEntity.js.map +1 -1
- package/dist/cache/entities/ServerTelemetryEntity.d.ts.map +1 -1
- package/dist/cache/entities/ServerTelemetryEntity.js +8 -9
- package/dist/cache/entities/ServerTelemetryEntity.js.map +1 -1
- package/dist/cache/entities/ThrottlingEntity.js +9 -11
- package/dist/cache/entities/ThrottlingEntity.js.map +1 -1
- package/dist/cache/interface/ICacheManager.d.ts.map +1 -1
- package/dist/cache/persistence/TokenCacheContext.d.ts.map +1 -1
- package/dist/cache/persistence/TokenCacheContext.js +16 -25
- package/dist/cache/persistence/TokenCacheContext.js.map +1 -1
- package/dist/cache/utils/CacheTypes.d.ts +11 -11
- package/dist/cache/utils/CacheTypes.d.ts.map +1 -1
- package/dist/client/AuthorizationCodeClient.d.ts.map +1 -1
- package/dist/client/AuthorizationCodeClient.js +341 -384
- package/dist/client/AuthorizationCodeClient.js.map +1 -1
- package/dist/client/BaseClient.d.ts.map +1 -1
- package/dist/client/BaseClient.js +27 -35
- package/dist/client/BaseClient.js.map +1 -1
- package/dist/client/RefreshTokenClient.d.ts.map +1 -1
- package/dist/client/RefreshTokenClient.js +208 -241
- package/dist/client/RefreshTokenClient.js.map +1 -1
- package/dist/client/SilentFlowClient.d.ts.map +1 -1
- package/dist/client/SilentFlowClient.js +77 -105
- package/dist/client/SilentFlowClient.js.map +1 -1
- package/dist/config/AppTokenProvider.d.ts +2 -2
- package/dist/config/AppTokenProvider.d.ts.map +1 -1
- package/dist/config/ClientConfiguration.d.ts +9 -9
- package/dist/config/ClientConfiguration.d.ts.map +1 -1
- package/dist/config/ClientConfiguration.js +40 -43
- package/dist/config/ClientConfiguration.js.map +1 -1
- package/dist/crypto/ICrypto.d.ts +2 -2
- package/dist/crypto/ICrypto.d.ts.map +1 -1
- package/dist/crypto/ICrypto.js +27 -58
- package/dist/crypto/ICrypto.js.map +1 -1
- package/dist/crypto/JoseHeader.d.ts +1 -1
- package/dist/crypto/JoseHeader.d.ts.map +1 -1
- package/dist/crypto/JoseHeader.js +8 -9
- package/dist/crypto/JoseHeader.js.map +1 -1
- package/dist/crypto/PopTokenGenerator.d.ts +2 -2
- package/dist/crypto/PopTokenGenerator.d.ts.map +1 -1
- package/dist/crypto/PopTokenGenerator.js +47 -71
- package/dist/crypto/PopTokenGenerator.js.map +1 -1
- package/dist/crypto/SignedHttpRequest.d.ts +1 -1
- package/dist/crypto/SignedHttpRequest.d.ts.map +1 -1
- package/dist/error/AuthError.d.ts.map +1 -1
- package/dist/error/AuthError.js +25 -28
- package/dist/error/AuthError.js.map +1 -1
- package/dist/error/ClientAuthError.d.ts +8 -0
- package/dist/error/ClientAuthError.d.ts.map +1 -1
- package/dist/error/ClientAuthError.js +187 -181
- package/dist/error/ClientAuthError.js.map +1 -1
- package/dist/error/ClientConfigurationError.d.ts.map +1 -1
- package/dist/error/ClientConfigurationError.js +82 -86
- package/dist/error/ClientConfigurationError.js.map +1 -1
- package/dist/error/InteractionRequiredAuthError.d.ts.map +1 -1
- package/dist/error/InteractionRequiredAuthError.js +36 -35
- package/dist/error/InteractionRequiredAuthError.js.map +1 -1
- package/dist/error/JoseHeaderError.d.ts.map +1 -1
- package/dist/error/JoseHeaderError.js +14 -18
- package/dist/error/JoseHeaderError.js.map +1 -1
- package/dist/error/ServerError.d.ts.map +1 -1
- package/dist/error/ServerError.js +7 -11
- package/dist/error/ServerError.js.map +1 -1
- package/dist/index.cjs.js +4221 -4476
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +20 -21
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -6
- package/dist/index.js.map +1 -1
- package/dist/logger/Logger.d.ts +1 -1
- package/dist/logger/Logger.d.ts.map +1 -1
- package/dist/logger/Logger.js +70 -60
- package/dist/logger/Logger.js.map +1 -1
- package/dist/network/INetworkModule.d.ts +1 -1
- package/dist/network/INetworkModule.d.ts.map +1 -1
- package/dist/network/INetworkModule.js +7 -7
- package/dist/network/INetworkModule.js.map +1 -1
- package/dist/network/NetworkManager.d.ts +4 -3
- package/dist/network/NetworkManager.d.ts.map +1 -1
- package/dist/network/NetworkManager.js +21 -35
- package/dist/network/NetworkManager.js.map +1 -1
- package/dist/network/RequestThumbprint.d.ts +1 -1
- package/dist/network/RequestThumbprint.d.ts.map +1 -1
- package/dist/network/ThrottlingUtils.d.ts.map +1 -1
- package/dist/network/ThrottlingUtils.js +37 -36
- package/dist/network/ThrottlingUtils.js.map +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.d.ts.map +1 -1
- package/dist/packageMetadata.js +3 -3
- package/dist/packageMetadata.js.map +1 -1
- package/dist/request/AuthenticationHeaderParser.d.ts.map +1 -1
- package/dist/request/AuthenticationHeaderParser.js +17 -18
- package/dist/request/AuthenticationHeaderParser.js.map +1 -1
- package/dist/request/BaseAuthRequest.d.ts +1 -1
- package/dist/request/BaseAuthRequest.d.ts.map +1 -1
- package/dist/request/CommonAuthorizationCodeRequest.d.ts +1 -1
- package/dist/request/CommonAuthorizationCodeRequest.d.ts.map +1 -1
- package/dist/request/CommonAuthorizationUrlRequest.d.ts +1 -1
- package/dist/request/CommonAuthorizationUrlRequest.d.ts.map +1 -1
- package/dist/request/CommonClientCredentialRequest.d.ts +1 -1
- package/dist/request/CommonClientCredentialRequest.d.ts.map +1 -1
- package/dist/request/CommonDeviceCodeRequest.d.ts +1 -1
- package/dist/request/CommonDeviceCodeRequest.d.ts.map +1 -1
- package/dist/request/CommonEndSessionRequest.d.ts +1 -1
- package/dist/request/CommonEndSessionRequest.d.ts.map +1 -1
- package/dist/request/CommonOnBehalfOfRequest.d.ts +1 -1
- package/dist/request/CommonOnBehalfOfRequest.d.ts.map +1 -1
- package/dist/request/CommonRefreshTokenRequest.d.ts +1 -1
- package/dist/request/CommonRefreshTokenRequest.d.ts.map +1 -1
- package/dist/request/CommonSilentFlowRequest.d.ts +1 -1
- package/dist/request/CommonSilentFlowRequest.d.ts.map +1 -1
- package/dist/request/CommonUsernamePasswordRequest.d.ts +1 -1
- package/dist/request/CommonUsernamePasswordRequest.d.ts.map +1 -1
- package/dist/request/NativeRequest.d.ts +1 -1
- package/dist/request/NativeRequest.d.ts.map +1 -1
- package/dist/request/NativeSignOutRequest.d.ts +1 -1
- package/dist/request/NativeSignOutRequest.d.ts.map +1 -1
- package/dist/request/RequestParameterBuilder.d.ts.map +1 -1
- package/dist/request/RequestParameterBuilder.js +111 -113
- package/dist/request/RequestParameterBuilder.js.map +1 -1
- package/dist/request/RequestValidator.d.ts.map +1 -1
- package/dist/request/RequestValidator.js +23 -28
- package/dist/request/RequestValidator.js.map +1 -1
- package/dist/request/ScopeSet.d.ts.map +1 -1
- package/dist/request/ScopeSet.js +70 -70
- package/dist/request/ScopeSet.js.map +1 -1
- package/dist/response/AuthenticationResult.d.ts +1 -1
- package/dist/response/AuthenticationResult.d.ts.map +1 -1
- package/dist/response/AuthorizationCodePayload.d.ts +1 -1
- package/dist/response/AuthorizationCodePayload.d.ts.map +1 -1
- package/dist/response/DeviceCodeResponse.d.ts +2 -2
- package/dist/response/DeviceCodeResponse.d.ts.map +1 -1
- package/dist/response/ExternalTokenResponse.d.ts +1 -1
- package/dist/response/ExternalTokenResponse.d.ts.map +1 -1
- package/dist/response/IMDSBadResponse.d.ts +1 -1
- package/dist/response/IMDSBadResponse.d.ts.map +1 -1
- package/dist/response/ResponseHandler.d.ts.map +1 -1
- package/dist/response/ResponseHandler.js +195 -180
- package/dist/response/ResponseHandler.js.map +1 -1
- package/dist/response/ServerAuthorizationCodeResponse.d.ts +1 -1
- package/dist/response/ServerAuthorizationCodeResponse.d.ts.map +1 -1
- package/dist/response/ServerAuthorizationTokenResponse.d.ts +1 -1
- package/dist/response/ServerAuthorizationTokenResponse.d.ts.map +1 -1
- package/dist/telemetry/performance/IPerformanceClient.d.ts +3 -4
- package/dist/telemetry/performance/IPerformanceClient.d.ts.map +1 -1
- package/dist/telemetry/performance/PerformanceClient.d.ts +2 -10
- package/dist/telemetry/performance/PerformanceClient.d.ts.map +1 -1
- package/dist/telemetry/performance/PerformanceClient.js +134 -129
- package/dist/telemetry/performance/PerformanceClient.js.map +1 -1
- package/dist/telemetry/performance/PerformanceEvent.d.ts +4 -4
- package/dist/telemetry/performance/PerformanceEvent.d.ts.map +1 -1
- package/dist/telemetry/performance/PerformanceEvent.js +2 -2
- package/dist/telemetry/performance/PerformanceEvent.js.map +1 -1
- package/dist/telemetry/performance/StubPerformanceClient.d.ts +5 -3
- package/dist/telemetry/performance/StubPerformanceClient.d.ts.map +1 -1
- package/dist/telemetry/performance/StubPerformanceClient.js +23 -32
- package/dist/telemetry/performance/StubPerformanceClient.js.map +1 -1
- package/dist/telemetry/server/ServerTelemetryManager.d.ts +1 -2
- package/dist/telemetry/server/ServerTelemetryManager.d.ts.map +1 -1
- package/dist/telemetry/server/ServerTelemetryManager.js +106 -68
- package/dist/telemetry/server/ServerTelemetryManager.js.map +1 -1
- package/dist/telemetry/server/ServerTelemetryRequest.d.ts +1 -1
- package/dist/telemetry/server/ServerTelemetryRequest.d.ts.map +1 -1
- package/dist/url/UrlString.d.ts.map +1 -1
- package/dist/url/UrlString.js +85 -74
- package/dist/url/UrlString.js.map +1 -1
- package/dist/utils/Constants.d.ts.map +1 -1
- package/dist/utils/Constants.js +28 -27
- package/dist/utils/Constants.js.map +1 -1
- package/dist/utils/MsalTypes.d.ts +1 -1
- package/dist/utils/MsalTypes.d.ts.map +1 -1
- package/dist/utils/ProtocolUtils.d.ts +2 -2
- package/dist/utils/ProtocolUtils.d.ts.map +1 -1
- package/dist/utils/ProtocolUtils.js +27 -24
- package/dist/utils/ProtocolUtils.js.map +1 -1
- package/dist/utils/StringUtils.d.ts.map +1 -1
- package/dist/utils/StringUtils.js +44 -42
- package/dist/utils/StringUtils.js.map +1 -1
- package/dist/utils/TimeUtils.d.ts.map +1 -1
- package/dist/utils/TimeUtils.js +16 -19
- package/dist/utils/TimeUtils.js.map +1 -1
- package/package.json +79 -76
- package/dist/_virtual/_tslib.js +0 -90
- package/dist/_virtual/_tslib.js.map +0 -1
- package/dist/client/ClientCredentialClient.d.ts +0 -38
- package/dist/client/ClientCredentialClient.d.ts.map +0 -1
- package/dist/client/ClientCredentialClient.js +0 -203
- package/dist/client/ClientCredentialClient.js.map +0 -1
- package/dist/client/DeviceCodeClient.d.ts +0 -57
- package/dist/client/DeviceCodeClient.d.ts.map +0 -1
- package/dist/client/DeviceCodeClient.js +0 -250
- package/dist/client/DeviceCodeClient.js.map +0 -1
- package/dist/client/OnBehalfOfClient.d.ts +0 -51
- package/dist/client/OnBehalfOfClient.d.ts.map +0 -1
- package/dist/client/OnBehalfOfClient.js +0 -248
- package/dist/client/OnBehalfOfClient.js.map +0 -1
- package/dist/client/UsernamePasswordClient.d.ts +0 -29
- package/dist/client/UsernamePasswordClient.d.ts.map +0 -1
- package/dist/client/UsernamePasswordClient.js +0 -129
- package/dist/client/UsernamePasswordClient.js.map +0 -1
package/dist/crypto/ICrypto.js
CHANGED
|
@@ -1,79 +1,48 @@
|
|
|
1
|
-
/*! @azure/msal-common
|
|
1
|
+
/*! @azure/msal-common v14.0.0-alpha.1 2023-05-08 */
|
|
2
2
|
'use strict';
|
|
3
|
-
import { __awaiter, __generator } from '../_virtual/_tslib.js';
|
|
4
3
|
import { AuthError } from '../error/AuthError.js';
|
|
5
4
|
|
|
6
5
|
/*
|
|
7
6
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
8
7
|
* Licensed under the MIT License.
|
|
9
8
|
*/
|
|
10
|
-
|
|
11
|
-
createNewGuid:
|
|
12
|
-
|
|
9
|
+
const DEFAULT_CRYPTO_IMPLEMENTATION = {
|
|
10
|
+
createNewGuid: () => {
|
|
11
|
+
const notImplErr = "Crypto interface - createNewGuid() has not been implemented";
|
|
13
12
|
throw AuthError.createUnexpectedError(notImplErr);
|
|
14
13
|
},
|
|
15
|
-
base64Decode:
|
|
16
|
-
|
|
14
|
+
base64Decode: () => {
|
|
15
|
+
const notImplErr = "Crypto interface - base64Decode() has not been implemented";
|
|
17
16
|
throw AuthError.createUnexpectedError(notImplErr);
|
|
18
17
|
},
|
|
19
|
-
base64Encode:
|
|
20
|
-
|
|
18
|
+
base64Encode: () => {
|
|
19
|
+
const notImplErr = "Crypto interface - base64Encode() has not been implemented";
|
|
21
20
|
throw AuthError.createUnexpectedError(notImplErr);
|
|
22
21
|
},
|
|
23
|
-
generatePkceCodes
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return __generator(this, function (_a) {
|
|
27
|
-
notImplErr = "Crypto interface - generatePkceCodes() has not been implemented";
|
|
28
|
-
throw AuthError.createUnexpectedError(notImplErr);
|
|
29
|
-
});
|
|
30
|
-
});
|
|
22
|
+
async generatePkceCodes() {
|
|
23
|
+
const notImplErr = "Crypto interface - generatePkceCodes() has not been implemented";
|
|
24
|
+
throw AuthError.createUnexpectedError(notImplErr);
|
|
31
25
|
},
|
|
32
|
-
getPublicKeyThumbprint
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return __generator(this, function (_a) {
|
|
36
|
-
notImplErr = "Crypto interface - getPublicKeyThumbprint() has not been implemented";
|
|
37
|
-
throw AuthError.createUnexpectedError(notImplErr);
|
|
38
|
-
});
|
|
39
|
-
});
|
|
26
|
+
async getPublicKeyThumbprint() {
|
|
27
|
+
const notImplErr = "Crypto interface - getPublicKeyThumbprint() has not been implemented";
|
|
28
|
+
throw AuthError.createUnexpectedError(notImplErr);
|
|
40
29
|
},
|
|
41
|
-
removeTokenBindingKey
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
return __generator(this, function (_a) {
|
|
45
|
-
notImplErr = "Crypto interface - removeTokenBindingKey() has not been implemented";
|
|
46
|
-
throw AuthError.createUnexpectedError(notImplErr);
|
|
47
|
-
});
|
|
48
|
-
});
|
|
30
|
+
async removeTokenBindingKey() {
|
|
31
|
+
const notImplErr = "Crypto interface - removeTokenBindingKey() has not been implemented";
|
|
32
|
+
throw AuthError.createUnexpectedError(notImplErr);
|
|
49
33
|
},
|
|
50
|
-
clearKeystore
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
return __generator(this, function (_a) {
|
|
54
|
-
notImplErr = "Crypto interface - clearKeystore() has not been implemented";
|
|
55
|
-
throw AuthError.createUnexpectedError(notImplErr);
|
|
56
|
-
});
|
|
57
|
-
});
|
|
34
|
+
async clearKeystore() {
|
|
35
|
+
const notImplErr = "Crypto interface - clearKeystore() has not been implemented";
|
|
36
|
+
throw AuthError.createUnexpectedError(notImplErr);
|
|
58
37
|
},
|
|
59
|
-
signJwt
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
});
|
|
38
|
+
async signJwt() {
|
|
39
|
+
const notImplErr = "Crypto interface - signJwt() has not been implemented";
|
|
40
|
+
throw AuthError.createUnexpectedError(notImplErr);
|
|
41
|
+
},
|
|
42
|
+
async hashString() {
|
|
43
|
+
const notImplErr = "Crypto interface - hashString() has not been implemented";
|
|
44
|
+
throw AuthError.createUnexpectedError(notImplErr);
|
|
67
45
|
},
|
|
68
|
-
hashString: function () {
|
|
69
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
70
|
-
var notImplErr;
|
|
71
|
-
return __generator(this, function (_a) {
|
|
72
|
-
notImplErr = "Crypto interface - hashString() has not been implemented";
|
|
73
|
-
throw AuthError.createUnexpectedError(notImplErr);
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
46
|
};
|
|
78
47
|
|
|
79
48
|
export { DEFAULT_CRYPTO_IMPLEMENTATION };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ICrypto.js","sources":["../../src/crypto/ICrypto.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"ICrypto.js","sources":["../../src/crypto/ICrypto.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAAA;;;AAGG;AA6EU,MAAA,6BAA6B,GAAY;IAClD,aAAa,EAAE,MAAa;QACxB,MAAM,UAAU,GACZ,6DAA6D,CAAC;AAClE,QAAA,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;KACrD;IACD,YAAY,EAAE,MAAa;QACvB,MAAM,UAAU,GACZ,4DAA4D,CAAC;AACjE,QAAA,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;KACrD;IACD,YAAY,EAAE,MAAa;QACvB,MAAM,UAAU,GACZ,4DAA4D,CAAC;AACjE,QAAA,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;KACrD;AACD,IAAA,MAAM,iBAAiB,GAAA;QACnB,MAAM,UAAU,GACZ,iEAAiE,CAAC;AACtE,QAAA,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;KACrD;AACD,IAAA,MAAM,sBAAsB,GAAA;QACxB,MAAM,UAAU,GACZ,sEAAsE,CAAC;AAC3E,QAAA,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;KACrD;AACD,IAAA,MAAM,qBAAqB,GAAA;QACvB,MAAM,UAAU,GACZ,qEAAqE,CAAC;AAC1E,QAAA,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;KACrD;AACD,IAAA,MAAM,aAAa,GAAA;QACf,MAAM,UAAU,GACZ,6DAA6D,CAAC;AAClE,QAAA,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;KACrD;AACD,IAAA,MAAM,OAAO,GAAA;QACT,MAAM,UAAU,GACZ,uDAAuD,CAAC;AAC5D,QAAA,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;KACrD;AACD,IAAA,MAAM,UAAU,GAAA;QACZ,MAAM,UAAU,GACZ,0DAA0D,CAAC;AAC/D,QAAA,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;KACrD;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JoseHeader.d.ts","sourceRoot":"","sources":["../../src/crypto/JoseHeader.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,
|
|
1
|
+
{"version":3,"file":"JoseHeader.d.ts","sourceRoot":"","sources":["../../src/crypto/JoseHeader.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,MAAM,MAAM,iBAAiB,GAAG;IAC5B,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,qBAAa,UAAU;IACZ,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;gBAER,OAAO,EAAE,iBAAiB;IAMtC;;;;;;;OAOG;IACH,MAAM,CAAC,kBAAkB,CAAC,gBAAgB,EAAE,iBAAiB,GAAG,MAAM;CAoBzE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-common
|
|
1
|
+
/*! @azure/msal-common v14.0.0-alpha.1 2023-05-08 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { JoseHeaderError } from '../error/JoseHeaderError.js';
|
|
4
4
|
import { JsonTypes } from '../utils/Constants.js';
|
|
@@ -7,8 +7,8 @@ import { JsonTypes } from '../utils/Constants.js';
|
|
|
7
7
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
8
8
|
* Licensed under the MIT License.
|
|
9
9
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
class JoseHeader {
|
|
11
|
+
constructor(options) {
|
|
12
12
|
this.typ = options.typ;
|
|
13
13
|
this.alg = options.alg;
|
|
14
14
|
this.kid = options.kid;
|
|
@@ -21,7 +21,7 @@ var JoseHeader = /** @class */ (function () {
|
|
|
21
21
|
* @param shrHeaderOptions
|
|
22
22
|
* @returns
|
|
23
23
|
*/
|
|
24
|
-
|
|
24
|
+
static getShrHeaderString(shrHeaderOptions) {
|
|
25
25
|
// KeyID is required on the SHR header
|
|
26
26
|
if (!shrHeaderOptions.kid) {
|
|
27
27
|
throw JoseHeaderError.createMissingKidError();
|
|
@@ -30,16 +30,15 @@ var JoseHeader = /** @class */ (function () {
|
|
|
30
30
|
if (!shrHeaderOptions.alg) {
|
|
31
31
|
throw JoseHeaderError.createMissingAlgError();
|
|
32
32
|
}
|
|
33
|
-
|
|
33
|
+
const shrHeader = new JoseHeader({
|
|
34
34
|
// Access Token PoP headers must have type pop, but the type header can be overriden for special cases
|
|
35
35
|
typ: shrHeaderOptions.typ || JsonTypes.Pop,
|
|
36
36
|
kid: shrHeaderOptions.kid,
|
|
37
|
-
alg: shrHeaderOptions.alg
|
|
37
|
+
alg: shrHeaderOptions.alg,
|
|
38
38
|
});
|
|
39
39
|
return JSON.stringify(shrHeader);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
}());
|
|
40
|
+
}
|
|
41
|
+
}
|
|
43
42
|
|
|
44
43
|
export { JoseHeader };
|
|
45
44
|
//# sourceMappingURL=JoseHeader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JoseHeader.js","sources":["../../src/crypto/JoseHeader.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"JoseHeader.js","sources":["../../src/crypto/JoseHeader.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAAA;;;AAGG;MAWU,UAAU,CAAA;AAKnB,IAAA,WAAA,CAAY,OAA0B,EAAA;AAClC,QAAA,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;AACvB,QAAA,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;AACvB,QAAA,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;KAC1B;AAED;;;;;;;AAOG;IACH,OAAO,kBAAkB,CAAC,gBAAmC,EAAA;;AAEzD,QAAA,IAAI,CAAC,gBAAgB,CAAC,GAAG,EAAE;AACvB,YAAA,MAAM,eAAe,CAAC,qBAAqB,EAAE,CAAC;AACjD,SAAA;;AAGD,QAAA,IAAI,CAAC,gBAAgB,CAAC,GAAG,EAAE;AACvB,YAAA,MAAM,eAAe,CAAC,qBAAqB,EAAE,CAAC;AACjD,SAAA;AAED,QAAA,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC;;AAE7B,YAAA,GAAG,EAAE,gBAAgB,CAAC,GAAG,IAAI,SAAS,CAAC,GAAG;YAC1C,GAAG,EAAE,gBAAgB,CAAC,GAAG;YACzB,GAAG,EAAE,gBAAgB,CAAC,GAAG;AAC5B,SAAA,CAAC,CAAC;AAEH,QAAA,OAAO,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;KACpC;AACJ;;;;"}
|
|
@@ -7,11 +7,11 @@ import { IPerformanceClient } from "../telemetry/performance/IPerformanceClient"
|
|
|
7
7
|
* - sw: software storage
|
|
8
8
|
* - uhw: hardware storage
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
type ReqCnf = {
|
|
11
11
|
kid: string;
|
|
12
12
|
xms_ksl: KeyLocation;
|
|
13
13
|
};
|
|
14
|
-
export
|
|
14
|
+
export type ReqCnfData = {
|
|
15
15
|
kid: string;
|
|
16
16
|
reqCnfString: string;
|
|
17
17
|
reqCnfHash: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopTokenGenerator.d.ts","sourceRoot":"","sources":["../../src/crypto/PopTokenGenerator.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,2BAA2B,EAAE,MAAM,WAAW,CAAC;AAGjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AAGjF;;;;;;GAMG;AACH,
|
|
1
|
+
{"version":3,"file":"PopTokenGenerator.d.ts","sourceRoot":"","sources":["../../src/crypto/PopTokenGenerator.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,2BAA2B,EAAE,MAAM,WAAW,CAAC;AAGjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AAGjF;;;;;;GAMG;AACH,KAAK,MAAM,GAAG;IACV,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,WAAW,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,aAAK,WAAW;IACZ,EAAE,OAAO;IACT,GAAG,QAAQ;CACd;AAED,qBAAa,iBAAiB;IAC1B,OAAO,CAAC,WAAW,CAAU;IAC7B,OAAO,CAAC,iBAAiB,CAAC,CAAqB;gBAEnC,WAAW,EAAE,OAAO,EAAE,iBAAiB,CAAC,EAAE,kBAAkB;IAKxE;;;;;OAKG;IACG,WAAW,CACb,OAAO,EAAE,2BAA2B,GACrC,OAAO,CAAC,UAAU,CAAC;IAsBtB;;;;OAIG;IACG,WAAW,CAAC,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,MAAM,CAAC;IAgBxE;;;;;OAKG;IACG,YAAY,CACd,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,2BAA2B,GACrC,OAAO,CAAC,MAAM,CAAC;IAIlB;;;;;;;OAOG;IACG,WAAW,CACb,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,2BAA2B,EACpC,MAAM,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,MAAM,CAAC;CA+BrB"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/*! @azure/msal-common
|
|
1
|
+
/*! @azure/msal-common v14.0.0-alpha.1 2023-05-08 */
|
|
2
2
|
'use strict';
|
|
3
|
-
import { __awaiter, __generator, __assign } from '../_virtual/_tslib.js';
|
|
4
3
|
import { TimeUtils } from '../utils/TimeUtils.js';
|
|
5
4
|
import { UrlString } from '../url/UrlString.js';
|
|
6
5
|
import { PerformanceEvents } from '../telemetry/performance/PerformanceEvent.js';
|
|
@@ -14,8 +13,8 @@ var KeyLocation;
|
|
|
14
13
|
KeyLocation["SW"] = "sw";
|
|
15
14
|
KeyLocation["UHW"] = "uhw";
|
|
16
15
|
})(KeyLocation || (KeyLocation = {}));
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
class PopTokenGenerator {
|
|
17
|
+
constructor(cryptoUtils, performanceClient) {
|
|
19
18
|
this.cryptoUtils = cryptoUtils;
|
|
20
19
|
this.performanceClient = performanceClient;
|
|
21
20
|
}
|
|
@@ -25,67 +24,39 @@ var PopTokenGenerator = /** @class */ (function () {
|
|
|
25
24
|
* @param request
|
|
26
25
|
* @returns
|
|
27
26
|
*/
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
reqCnf = _d.sent();
|
|
40
|
-
reqCnfString = this.cryptoUtils.base64Encode(JSON.stringify(reqCnf));
|
|
41
|
-
_c = {
|
|
42
|
-
kid: reqCnf.kid,
|
|
43
|
-
reqCnfString: reqCnfString
|
|
44
|
-
};
|
|
45
|
-
return [4 /*yield*/, this.cryptoUtils.hashString(reqCnfString)];
|
|
46
|
-
case 2: return [2 /*return*/, (_c.reqCnfHash = _d.sent(),
|
|
47
|
-
_c)];
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
};
|
|
27
|
+
async generateCnf(request) {
|
|
28
|
+
this.performanceClient?.addQueueMeasurement(PerformanceEvents.PopTokenGenerateCnf, request.correlationId);
|
|
29
|
+
this.performanceClient?.setPreQueueTime(PerformanceEvents.PopTokenGenerateKid, request.correlationId);
|
|
30
|
+
const reqCnf = await this.generateKid(request);
|
|
31
|
+
const reqCnfString = this.cryptoUtils.base64Encode(JSON.stringify(reqCnf));
|
|
32
|
+
return {
|
|
33
|
+
kid: reqCnf.kid,
|
|
34
|
+
reqCnfString,
|
|
35
|
+
reqCnfHash: await this.cryptoUtils.hashString(reqCnfString),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
52
38
|
/**
|
|
53
39
|
* Generates key_id for a SHR token request
|
|
54
40
|
* @param request
|
|
55
41
|
* @returns
|
|
56
42
|
*/
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
return [4 /*yield*/, this.cryptoUtils.getPublicKeyThumbprint(request)];
|
|
66
|
-
case 1:
|
|
67
|
-
kidThumbprint = _b.sent();
|
|
68
|
-
return [2 /*return*/, {
|
|
69
|
-
kid: kidThumbprint,
|
|
70
|
-
xms_ksl: KeyLocation.SW
|
|
71
|
-
}];
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
});
|
|
75
|
-
};
|
|
43
|
+
async generateKid(request) {
|
|
44
|
+
this.performanceClient?.addQueueMeasurement(PerformanceEvents.PopTokenGenerateKid, request.correlationId);
|
|
45
|
+
const kidThumbprint = await this.cryptoUtils.getPublicKeyThumbprint(request);
|
|
46
|
+
return {
|
|
47
|
+
kid: kidThumbprint,
|
|
48
|
+
xms_ksl: KeyLocation.SW,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
76
51
|
/**
|
|
77
52
|
* Signs the POP access_token with the local generated key-pair
|
|
78
53
|
* @param accessToken
|
|
79
54
|
* @param request
|
|
80
55
|
* @returns
|
|
81
56
|
*/
|
|
82
|
-
|
|
83
|
-
return
|
|
84
|
-
|
|
85
|
-
return [2 /*return*/, this.signPayload(accessToken, keyId, request)];
|
|
86
|
-
});
|
|
87
|
-
});
|
|
88
|
-
};
|
|
57
|
+
async signPopToken(accessToken, keyId, request) {
|
|
58
|
+
return this.signPayload(accessToken, keyId, request);
|
|
59
|
+
}
|
|
89
60
|
/**
|
|
90
61
|
* Utility function to generate the signed JWT for an access_token
|
|
91
62
|
* @param payload
|
|
@@ -94,23 +65,28 @@ var PopTokenGenerator = /** @class */ (function () {
|
|
|
94
65
|
* @param claims
|
|
95
66
|
* @returns
|
|
96
67
|
*/
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
68
|
+
async signPayload(payload, keyId, request, claims) {
|
|
69
|
+
// Deconstruct request to extract SHR parameters
|
|
70
|
+
const { resourceRequestMethod, resourceRequestUri, shrClaims, shrNonce, } = request;
|
|
71
|
+
const resourceUrlString = resourceRequestUri
|
|
72
|
+
? new UrlString(resourceRequestUri)
|
|
73
|
+
: undefined;
|
|
74
|
+
const resourceUrlComponents = resourceUrlString?.getUrlComponents();
|
|
75
|
+
return await this.cryptoUtils.signJwt({
|
|
76
|
+
at: payload,
|
|
77
|
+
ts: TimeUtils.nowSeconds(),
|
|
78
|
+
m: resourceRequestMethod?.toUpperCase(),
|
|
79
|
+
u: resourceUrlComponents?.HostNameAndPort,
|
|
80
|
+
nonce: shrNonce || this.cryptoUtils.createNewGuid(),
|
|
81
|
+
p: resourceUrlComponents?.AbsolutePath,
|
|
82
|
+
q: resourceUrlComponents?.QueryString
|
|
83
|
+
? [[], resourceUrlComponents.QueryString]
|
|
84
|
+
: undefined,
|
|
85
|
+
client_claims: shrClaims || undefined,
|
|
86
|
+
...claims,
|
|
87
|
+
}, keyId, request.correlationId);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
114
90
|
|
|
115
91
|
export { PopTokenGenerator };
|
|
116
92
|
//# sourceMappingURL=PopTokenGenerator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopTokenGenerator.js","sources":["../../src/crypto/PopTokenGenerator.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"PopTokenGenerator.js","sources":["../../src/crypto/PopTokenGenerator.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;AAAA;;;AAGG;AA0BH,IAAK,WAGJ,CAAA;AAHD,CAAA,UAAK,WAAW,EAAA;AACZ,IAAA,WAAA,CAAA,IAAA,CAAA,GAAA,IAAS,CAAA;AACT,IAAA,WAAA,CAAA,KAAA,CAAA,GAAA,KAAW,CAAA;AACf,CAAC,EAHI,WAAW,KAAX,WAAW,GAGf,EAAA,CAAA,CAAA,CAAA;MAEY,iBAAiB,CAAA;IAI1B,WAAY,CAAA,WAAoB,EAAE,iBAAsC,EAAA;AACpE,QAAA,IAAI,CAAC,WAAW,GAAG,WAAW,CA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,KAAa,EACb,OAAoC,EACpC,MAAe,EAAA;;QAGf,MAAM,EACF,qBAAqB,EACrB,kBAAkB,EAClB,SAAS,EACT,QAAQ,GACX,GAAG,OAAO,CAAC;QAEZ,MAAM,iBAAiB,GAAG,kBAAkB;AACxC,cAAE,IAAI,SAAS,CAAC,kBAAkB,CAAC;cACjC,SAAS,CAAC;AAChB,QAAA,MAAM,qBAAqB,GAAG,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;AACpE,QAAA,OAAO,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CACjC;AACI,YAAA,EAAE,EAAE,OAAO;AACX,YAAA,EAAE,EAAE,SAAS,CAAC,UAAU,EAAE;AAC1B,YAAA,CAAC,EAAE,qBAAqB,EAAE,WAAW,EAAE;YACvC,CAAC,EAAE,qBAAqB,EAAE,eAAe;YACzC,KAAK,EAAE,QAAQ,IAAI,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE;YACnD,CAAC,EAAE,qBAAqB,EAAE,YAAY;YACtC,CAAC,EAAE,qBAAqB,EAAE,WAAW;AACjC,kBAAE,CAAC,EAAE,EAAE,qBAAqB,CAAC,WAAW,CAAC;AACzC,kBAAE,SAAS;YACf,aAAa,EAAE,SAAS,IAAI,SAAS;AACrC,YAAA,GAAG,MAAM;AACZ,SAAA,EACD,KAAK,EACL,OAAO,CAAC,aAAa,CACxB,CAAC;KACL;AACJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignedHttpRequest.d.ts","sourceRoot":"","sources":["../../src/crypto/SignedHttpRequest.ts"],"names":[],"mappings":"AAKA,
|
|
1
|
+
{"version":3,"file":"SignedHttpRequest.d.ts","sourceRoot":"","sources":["../../src/crypto/SignedHttpRequest.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,iBAAiB,GAAG;IAC5B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;IAC5B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthError.d.ts","sourceRoot":"","sources":["../../src/error/AuthError.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;CAS5B,CAAC;AAEF;;GAEG;AACH,qBAAa,SAAU,SAAQ,KAAK;
|
|
1
|
+
{"version":3,"file":"AuthError.d.ts","sourceRoot":"","sources":["../../src/error/AuthError.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;CAS5B,CAAC;AAEF;;GAEG;AACH,qBAAa,SAAU,SAAQ,KAAK;IAChC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;gBAEV,SAAS,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM;IAaxE,gBAAgB,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI;IAI7C;;;OAGG;IACH,MAAM,CAAC,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS;IAOxD;;;;OAIG;IACH,MAAM,CAAC,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS;CAM7D"}
|
package/dist/error/AuthError.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/*! @azure/msal-common
|
|
1
|
+
/*! @azure/msal-common v14.0.0-alpha.1 2023-05-08 */
|
|
2
2
|
'use strict';
|
|
3
|
-
import { __extends } from '../_virtual/_tslib.js';
|
|
4
3
|
import { Constants } from '../utils/Constants.js';
|
|
5
4
|
|
|
6
5
|
/*
|
|
@@ -10,52 +9,50 @@ import { Constants } from '../utils/Constants.js';
|
|
|
10
9
|
/**
|
|
11
10
|
* AuthErrorMessage class containing string constants used by error codes and messages.
|
|
12
11
|
*/
|
|
13
|
-
|
|
12
|
+
const AuthErrorMessage = {
|
|
14
13
|
unexpectedError: {
|
|
15
14
|
code: "unexpected_error",
|
|
16
|
-
desc: "Unexpected error in authentication."
|
|
15
|
+
desc: "Unexpected error in authentication.",
|
|
17
16
|
},
|
|
18
17
|
postRequestFailed: {
|
|
19
18
|
code: "post_request_failed",
|
|
20
|
-
desc: "Post request failed from the network, could be a 4xx/5xx or a network unavailability. Please check the exact error code for details."
|
|
21
|
-
}
|
|
19
|
+
desc: "Post request failed from the network, could be a 4xx/5xx or a network unavailability. Please check the exact error code for details.",
|
|
20
|
+
},
|
|
22
21
|
};
|
|
23
22
|
/**
|
|
24
23
|
* General error class thrown by the MSAL.js library.
|
|
25
24
|
*/
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
Object.setPrototypeOf(
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return _this;
|
|
25
|
+
class AuthError extends Error {
|
|
26
|
+
constructor(errorCode, errorMessage, suberror) {
|
|
27
|
+
const errorString = errorMessage
|
|
28
|
+
? `${errorCode}: ${errorMessage}`
|
|
29
|
+
: errorCode;
|
|
30
|
+
super(errorString);
|
|
31
|
+
Object.setPrototypeOf(this, AuthError.prototype);
|
|
32
|
+
this.errorCode = errorCode || Constants.EMPTY_STRING;
|
|
33
|
+
this.errorMessage = errorMessage || Constants.EMPTY_STRING;
|
|
34
|
+
this.subError = suberror || Constants.EMPTY_STRING;
|
|
35
|
+
this.name = "AuthError";
|
|
38
36
|
}
|
|
39
|
-
|
|
37
|
+
setCorrelationId(correlationId) {
|
|
40
38
|
this.correlationId = correlationId;
|
|
41
|
-
}
|
|
39
|
+
}
|
|
42
40
|
/**
|
|
43
41
|
* Creates an error that is thrown when something unexpected happens in the library.
|
|
44
42
|
* @param errDesc
|
|
45
43
|
*/
|
|
46
|
-
|
|
47
|
-
return new AuthError(AuthErrorMessage.unexpectedError.code, AuthErrorMessage.unexpectedError.desc
|
|
48
|
-
}
|
|
44
|
+
static createUnexpectedError(errDesc) {
|
|
45
|
+
return new AuthError(AuthErrorMessage.unexpectedError.code, `${AuthErrorMessage.unexpectedError.desc}: ${errDesc}`);
|
|
46
|
+
}
|
|
49
47
|
/**
|
|
50
48
|
* Creates an error for post request failures.
|
|
51
49
|
* @param errDesc
|
|
52
50
|
* @returns
|
|
53
51
|
*/
|
|
54
|
-
|
|
55
|
-
return new AuthError(AuthErrorMessage.postRequestFailed.code, AuthErrorMessage.postRequestFailed.desc
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
}(Error));
|
|
52
|
+
static createPostRequestFailed(errDesc) {
|
|
53
|
+
return new AuthError(AuthErrorMessage.postRequestFailed.code, `${AuthErrorMessage.postRequestFailed.desc}: ${errDesc}`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
59
56
|
|
|
60
57
|
export { AuthError, AuthErrorMessage };
|
|
61
58
|
//# sourceMappingURL=AuthError.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthError.js","sources":["../../src/error/AuthError.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"AuthError.js","sources":["../../src/error/AuthError.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAAA;;;AAGG;AAIH;;AAEG;AACU,MAAA,gBAAgB,GAAG;AAC5B,IAAA,eAAe,EAAE;AACb,QAAA,IAAI,EAAE,kBAAkB;AACxB,QAAA,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,CAC3D,CAAC;KACL;AACJ;;;;"}
|
|
@@ -203,6 +203,10 @@ export declare const ClientAuthErrorMessage: {
|
|
|
203
203
|
code: string;
|
|
204
204
|
desc: string;
|
|
205
205
|
};
|
|
206
|
+
missingTenantIdError: {
|
|
207
|
+
code: string;
|
|
208
|
+
desc: string;
|
|
209
|
+
};
|
|
206
210
|
};
|
|
207
211
|
/**
|
|
208
212
|
* Error thrown when there is an error in the client code running on the browser.
|
|
@@ -401,5 +405,9 @@ export declare class ClientAuthError extends AuthError {
|
|
|
401
405
|
* Create an error when the user cancels the flow
|
|
402
406
|
*/
|
|
403
407
|
static createUserCanceledError(): ClientAuthError;
|
|
408
|
+
/**
|
|
409
|
+
* Creates an error for during acquireTokenByClientCredential when TenantId is set to "common" or "organizations"
|
|
410
|
+
*/
|
|
411
|
+
static createMissingTenantIdError(): ClientAuthError;
|
|
404
412
|
}
|
|
405
413
|
//# sourceMappingURL=ClientAuthError.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClientAuthError.d.ts","sourceRoot":"","sources":["../../src/error/ClientAuthError.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;GAEG;AACH,eAAO,MAAM,sBAAsB
|
|
1
|
+
{"version":3,"file":"ClientAuthError.d.ts","sourceRoot":"","sources":["../../src/error/ClientAuthError.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkNlC,CAAC;A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