@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
|
@@ -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 { AuthError } from './AuthError.js';
|
|
5
4
|
|
|
6
5
|
/*
|
|
@@ -10,169 +9,169 @@ import { AuthError } from './AuthError.js';
|
|
|
10
9
|
/**
|
|
11
10
|
* ClientAuthErrorMessage class containing string constants used by error codes and messages.
|
|
12
11
|
*/
|
|
13
|
-
|
|
12
|
+
const ClientAuthErrorMessage = {
|
|
14
13
|
clientInfoDecodingError: {
|
|
15
14
|
code: "client_info_decoding_error",
|
|
16
|
-
desc: "The client info could not be parsed/decoded correctly. Please review the trace to determine the root cause."
|
|
15
|
+
desc: "The client info could not be parsed/decoded correctly. Please review the trace to determine the root cause.",
|
|
17
16
|
},
|
|
18
17
|
clientInfoEmptyError: {
|
|
19
18
|
code: "client_info_empty_error",
|
|
20
|
-
desc: "The client info was empty. Please review the trace to determine the root cause."
|
|
19
|
+
desc: "The client info was empty. Please review the trace to determine the root cause.",
|
|
21
20
|
},
|
|
22
21
|
tokenParsingError: {
|
|
23
22
|
code: "token_parsing_error",
|
|
24
|
-
desc: "Token cannot be parsed. Please review stack trace to determine root cause."
|
|
23
|
+
desc: "Token cannot be parsed. Please review stack trace to determine root cause.",
|
|
25
24
|
},
|
|
26
25
|
nullOrEmptyToken: {
|
|
27
26
|
code: "null_or_empty_token",
|
|
28
|
-
desc: "The token is null or empty. Please review the trace to determine the root cause."
|
|
27
|
+
desc: "The token is null or empty. Please review the trace to determine the root cause.",
|
|
29
28
|
},
|
|
30
29
|
endpointResolutionError: {
|
|
31
30
|
code: "endpoints_resolution_error",
|
|
32
|
-
desc: "Error: could not resolve endpoints. Please check network and try again."
|
|
31
|
+
desc: "Error: could not resolve endpoints. Please check network and try again.",
|
|
33
32
|
},
|
|
34
33
|
networkError: {
|
|
35
34
|
code: "network_error",
|
|
36
|
-
desc: "Network request failed. Please check network trace to determine root cause."
|
|
35
|
+
desc: "Network request failed. Please check network trace to determine root cause.",
|
|
37
36
|
},
|
|
38
37
|
unableToGetOpenidConfigError: {
|
|
39
38
|
code: "openid_config_error",
|
|
40
|
-
desc: "Could not retrieve endpoints. Check your authority and verify the .well-known/openid-configuration endpoint returns the required endpoints."
|
|
39
|
+
desc: "Could not retrieve endpoints. Check your authority and verify the .well-known/openid-configuration endpoint returns the required endpoints.",
|
|
41
40
|
},
|
|
42
41
|
hashNotDeserialized: {
|
|
43
42
|
code: "hash_not_deserialized",
|
|
44
|
-
desc: "The hash parameters could not be deserialized. Please review the trace to determine the root cause."
|
|
43
|
+
desc: "The hash parameters could not be deserialized. Please review the trace to determine the root cause.",
|
|
45
44
|
},
|
|
46
45
|
blankGuidGenerated: {
|
|
47
46
|
code: "blank_guid_generated",
|
|
48
|
-
desc: "The guid generated was blank. Please review the trace to determine the root cause."
|
|
47
|
+
desc: "The guid generated was blank. Please review the trace to determine the root cause.",
|
|
49
48
|
},
|
|
50
49
|
invalidStateError: {
|
|
51
50
|
code: "invalid_state",
|
|
52
|
-
desc: "State was not the expected format. Please check the logs to determine whether the request was sent using ProtocolUtils.setRequestState()."
|
|
51
|
+
desc: "State was not the expected format. Please check the logs to determine whether the request was sent using ProtocolUtils.setRequestState().",
|
|
53
52
|
},
|
|
54
53
|
stateMismatchError: {
|
|
55
54
|
code: "state_mismatch",
|
|
56
|
-
desc: "State mismatch error. Please check your network. Continued requests may cause cache overflow."
|
|
55
|
+
desc: "State mismatch error. Please check your network. Continued requests may cause cache overflow.",
|
|
57
56
|
},
|
|
58
57
|
stateNotFoundError: {
|
|
59
58
|
code: "state_not_found",
|
|
60
|
-
desc: "State not found"
|
|
59
|
+
desc: "State not found",
|
|
61
60
|
},
|
|
62
61
|
nonceMismatchError: {
|
|
63
62
|
code: "nonce_mismatch",
|
|
64
|
-
desc: "Nonce mismatch error. This may be caused by a race condition in concurrent requests."
|
|
63
|
+
desc: "Nonce mismatch error. This may be caused by a race condition in concurrent requests.",
|
|
65
64
|
},
|
|
66
65
|
nonceNotFoundError: {
|
|
67
66
|
code: "nonce_not_found",
|
|
68
|
-
desc: "nonce not found"
|
|
67
|
+
desc: "nonce not found",
|
|
69
68
|
},
|
|
70
69
|
authTimeNotFoundError: {
|
|
71
70
|
code: "auth_time_not_found",
|
|
72
71
|
desc: "Max Age was requested and the ID token is missing the auth_time variable." +
|
|
73
72
|
" auth_time is an optional claim and is not enabled by default - it must be enabled." +
|
|
74
|
-
" See https://aka.ms/msaljs/optional-claims for more information."
|
|
73
|
+
" See https://aka.ms/msaljs/optional-claims for more information.",
|
|
75
74
|
},
|
|
76
75
|
maxAgeTranspiredError: {
|
|
77
76
|
code: "max_age_transpired",
|
|
78
|
-
desc: "Max Age is set to 0, or too much time has elapsed since the last end-user authentication."
|
|
77
|
+
desc: "Max Age is set to 0, or too much time has elapsed since the last end-user authentication.",
|
|
79
78
|
},
|
|
80
79
|
noTokensFoundError: {
|
|
81
80
|
code: "no_tokens_found",
|
|
82
|
-
desc: "No tokens were found for the given scopes, and no authorization code was passed to acquireToken. You must retrieve an authorization code before making a call to acquireToken()."
|
|
81
|
+
desc: "No tokens were found for the given scopes, and no authorization code was passed to acquireToken. You must retrieve an authorization code before making a call to acquireToken().",
|
|
83
82
|
},
|
|
84
83
|
multipleMatchingTokens: {
|
|
85
84
|
code: "multiple_matching_tokens",
|
|
86
85
|
desc: "The cache contains multiple tokens satisfying the requirements. " +
|
|
87
|
-
"Call AcquireToken again providing more requirements such as authority or account."
|
|
86
|
+
"Call AcquireToken again providing more requirements such as authority or account.",
|
|
88
87
|
},
|
|
89
88
|
multipleMatchingAccounts: {
|
|
90
89
|
code: "multiple_matching_accounts",
|
|
91
|
-
desc: "The cache contains multiple accounts satisfying the given parameters. Please pass more info to obtain the correct account"
|
|
90
|
+
desc: "The cache contains multiple accounts satisfying the given parameters. Please pass more info to obtain the correct account",
|
|
92
91
|
},
|
|
93
92
|
multipleMatchingAppMetadata: {
|
|
94
93
|
code: "multiple_matching_appMetadata",
|
|
95
|
-
desc: "The cache contains multiple appMetadata satisfying the given parameters. Please pass more info to obtain the correct appMetadata"
|
|
94
|
+
desc: "The cache contains multiple appMetadata satisfying the given parameters. Please pass more info to obtain the correct appMetadata",
|
|
96
95
|
},
|
|
97
96
|
tokenRequestCannotBeMade: {
|
|
98
97
|
code: "request_cannot_be_made",
|
|
99
|
-
desc: "Token request cannot be made without authorization code or refresh token."
|
|
98
|
+
desc: "Token request cannot be made without authorization code or refresh token.",
|
|
100
99
|
},
|
|
101
100
|
appendEmptyScopeError: {
|
|
102
101
|
code: "cannot_append_empty_scope",
|
|
103
|
-
desc: "Cannot append null or empty scope to ScopeSet. Please check the stack trace for more info."
|
|
102
|
+
desc: "Cannot append null or empty scope to ScopeSet. Please check the stack trace for more info.",
|
|
104
103
|
},
|
|
105
104
|
removeEmptyScopeError: {
|
|
106
105
|
code: "cannot_remove_empty_scope",
|
|
107
|
-
desc: "Cannot remove null or empty scope from ScopeSet. Please check the stack trace for more info."
|
|
106
|
+
desc: "Cannot remove null or empty scope from ScopeSet. Please check the stack trace for more info.",
|
|
108
107
|
},
|
|
109
108
|
appendScopeSetError: {
|
|
110
109
|
code: "cannot_append_scopeset",
|
|
111
|
-
desc: "Cannot append ScopeSet due to error."
|
|
110
|
+
desc: "Cannot append ScopeSet due to error.",
|
|
112
111
|
},
|
|
113
112
|
emptyInputScopeSetError: {
|
|
114
113
|
code: "empty_input_scopeset",
|
|
115
|
-
desc: "Empty input ScopeSet cannot be processed."
|
|
114
|
+
desc: "Empty input ScopeSet cannot be processed.",
|
|
116
115
|
},
|
|
117
116
|
DeviceCodePollingCancelled: {
|
|
118
117
|
code: "device_code_polling_cancelled",
|
|
119
|
-
desc: "Caller has cancelled token endpoint polling during device code flow by setting DeviceCodeRequest.cancel = true."
|
|
118
|
+
desc: "Caller has cancelled token endpoint polling during device code flow by setting DeviceCodeRequest.cancel = true.",
|
|
120
119
|
},
|
|
121
120
|
DeviceCodeExpired: {
|
|
122
121
|
code: "device_code_expired",
|
|
123
|
-
desc: "Device code is expired."
|
|
122
|
+
desc: "Device code is expired.",
|
|
124
123
|
},
|
|
125
124
|
DeviceCodeUnknownError: {
|
|
126
125
|
code: "device_code_unknown_error",
|
|
127
|
-
desc: "Device code stopped polling for unknown reasons."
|
|
126
|
+
desc: "Device code stopped polling for unknown reasons.",
|
|
128
127
|
},
|
|
129
128
|
NoAccountInSilentRequest: {
|
|
130
129
|
code: "no_account_in_silent_request",
|
|
131
|
-
desc: "Please pass an account object, silent flow is not supported without account information"
|
|
130
|
+
desc: "Please pass an account object, silent flow is not supported without account information",
|
|
132
131
|
},
|
|
133
132
|
invalidCacheRecord: {
|
|
134
133
|
code: "invalid_cache_record",
|
|
135
|
-
desc: "Cache record object was null or undefined."
|
|
134
|
+
desc: "Cache record object was null or undefined.",
|
|
136
135
|
},
|
|
137
136
|
invalidCacheEnvironment: {
|
|
138
137
|
code: "invalid_cache_environment",
|
|
139
|
-
desc: "Invalid environment when attempting to create cache entry"
|
|
138
|
+
desc: "Invalid environment when attempting to create cache entry",
|
|
140
139
|
},
|
|
141
140
|
noAccountFound: {
|
|
142
141
|
code: "no_account_found",
|
|
143
|
-
desc: "No account found in cache for given key."
|
|
142
|
+
desc: "No account found in cache for given key.",
|
|
144
143
|
},
|
|
145
144
|
CachePluginError: {
|
|
146
145
|
code: "no cache plugin set on CacheManager",
|
|
147
|
-
desc: "ICachePlugin needs to be set before using readFromStorage or writeFromStorage"
|
|
146
|
+
desc: "ICachePlugin needs to be set before using readFromStorage or writeFromStorage",
|
|
148
147
|
},
|
|
149
148
|
noCryptoObj: {
|
|
150
149
|
code: "no_crypto_object",
|
|
151
|
-
desc: "No crypto object detected. This is required for the following operation: "
|
|
150
|
+
desc: "No crypto object detected. This is required for the following operation: ",
|
|
152
151
|
},
|
|
153
152
|
invalidCacheType: {
|
|
154
153
|
code: "invalid_cache_type",
|
|
155
|
-
desc: "Invalid cache type"
|
|
154
|
+
desc: "Invalid cache type",
|
|
156
155
|
},
|
|
157
156
|
unexpectedAccountType: {
|
|
158
157
|
code: "unexpected_account_type",
|
|
159
|
-
desc: "Unexpected account type."
|
|
158
|
+
desc: "Unexpected account type.",
|
|
160
159
|
},
|
|
161
160
|
unexpectedCredentialType: {
|
|
162
161
|
code: "unexpected_credential_type",
|
|
163
|
-
desc: "Unexpected credential type."
|
|
162
|
+
desc: "Unexpected credential type.",
|
|
164
163
|
},
|
|
165
164
|
invalidAssertion: {
|
|
166
165
|
code: "invalid_assertion",
|
|
167
|
-
desc: "Client assertion must meet requirements described in https://tools.ietf.org/html/rfc7515"
|
|
166
|
+
desc: "Client assertion must meet requirements described in https://tools.ietf.org/html/rfc7515",
|
|
168
167
|
},
|
|
169
168
|
invalidClientCredential: {
|
|
170
169
|
code: "invalid_client_credential",
|
|
171
|
-
desc: "Client credential (secret, certificate, or assertion) must not be empty when creating a confidential client. An application should at most have one credential"
|
|
170
|
+
desc: "Client credential (secret, certificate, or assertion) must not be empty when creating a confidential client. An application should at most have one credential",
|
|
172
171
|
},
|
|
173
172
|
tokenRefreshRequired: {
|
|
174
173
|
code: "token_refresh_required",
|
|
175
|
-
desc: "Cannot return token from cache because it must be refreshed. This may be due to one of the following reasons: forceRefresh parameter is set to true, claims have been requested, there is no cached access token or it is expired."
|
|
174
|
+
desc: "Cannot return token from cache because it must be refreshed. This may be due to one of the following reasons: forceRefresh parameter is set to true, claims have been requested, there is no cached access token or it is expired.",
|
|
176
175
|
},
|
|
177
176
|
userTimeoutReached: {
|
|
178
177
|
code: "user_timeout_reached",
|
|
@@ -180,341 +179,348 @@ var ClientAuthErrorMessage = {
|
|
|
180
179
|
},
|
|
181
180
|
tokenClaimsRequired: {
|
|
182
181
|
code: "token_claims_cnf_required_for_signedjwt",
|
|
183
|
-
desc: "Cannot generate a POP jwt if the token_claims are not populated"
|
|
182
|
+
desc: "Cannot generate a POP jwt if the token_claims are not populated",
|
|
184
183
|
},
|
|
185
184
|
noAuthorizationCodeFromServer: {
|
|
186
185
|
code: "authorization_code_missing_from_server_response",
|
|
187
|
-
desc: "Server response does not contain an authorization code to proceed"
|
|
186
|
+
desc: "Server response does not contain an authorization code to proceed",
|
|
188
187
|
},
|
|
189
188
|
noAzureRegionDetected: {
|
|
190
189
|
code: "no_azure_region_detected",
|
|
191
|
-
desc: "No azure region was detected and no fallback was made available"
|
|
190
|
+
desc: "No azure region was detected and no fallback was made available",
|
|
192
191
|
},
|
|
193
192
|
accessTokenEntityNullError: {
|
|
194
193
|
code: "access_token_entity_null",
|
|
195
|
-
desc: "Access token entity is null, please check logs and cache to ensure a valid access token is present."
|
|
194
|
+
desc: "Access token entity is null, please check logs and cache to ensure a valid access token is present.",
|
|
196
195
|
},
|
|
197
196
|
bindingKeyNotRemovedError: {
|
|
198
197
|
code: "binding_key_not_removed",
|
|
199
|
-
desc: "Could not remove the credential's binding key from storage."
|
|
198
|
+
desc: "Could not remove the credential's binding key from storage.",
|
|
200
199
|
},
|
|
201
200
|
logoutNotSupported: {
|
|
202
201
|
code: "end_session_endpoint_not_supported",
|
|
203
|
-
desc: "Provided authority does not support logout."
|
|
202
|
+
desc: "Provided authority does not support logout.",
|
|
204
203
|
},
|
|
205
204
|
keyIdMissing: {
|
|
206
205
|
code: "key_id_missing",
|
|
207
|
-
desc: "A keyId value is missing from the requested bound token's cache record and is required to match the token to it's stored binding key."
|
|
206
|
+
desc: "A keyId value is missing from the requested bound token's cache record and is required to match the token to it's stored binding key.",
|
|
208
207
|
},
|
|
209
208
|
noNetworkConnectivity: {
|
|
210
209
|
code: "no_network_connectivity",
|
|
211
|
-
desc: "No network connectivity. Check your internet connection."
|
|
210
|
+
desc: "No network connectivity. Check your internet connection.",
|
|
212
211
|
},
|
|
213
212
|
userCanceledError: {
|
|
214
213
|
code: "user_canceled",
|
|
215
|
-
desc: "User canceled the flow."
|
|
216
|
-
}
|
|
214
|
+
desc: "User canceled the flow.",
|
|
215
|
+
},
|
|
216
|
+
missingTenantIdError: {
|
|
217
|
+
code: "missing_tenant_id_error",
|
|
218
|
+
desc: "A tenant id - not common, organizations, or consumers - must be specified when using the client_credentials flow.",
|
|
219
|
+
},
|
|
217
220
|
};
|
|
218
221
|
/**
|
|
219
222
|
* Error thrown when there is an error in the client code running on the browser.
|
|
220
223
|
*/
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
Object.setPrototypeOf(_this, ClientAuthError.prototype);
|
|
227
|
-
return _this;
|
|
224
|
+
class ClientAuthError extends AuthError {
|
|
225
|
+
constructor(errorCode, errorMessage) {
|
|
226
|
+
super(errorCode, errorMessage);
|
|
227
|
+
this.name = "ClientAuthError";
|
|
228
|
+
Object.setPrototypeOf(this, ClientAuthError.prototype);
|
|
228
229
|
}
|
|
229
230
|
/**
|
|
230
231
|
* Creates an error thrown when client info object doesn't decode correctly.
|
|
231
232
|
* @param caughtError
|
|
232
233
|
*/
|
|
233
|
-
|
|
234
|
-
return new ClientAuthError(ClientAuthErrorMessage.clientInfoDecodingError.code, ClientAuthErrorMessage.clientInfoDecodingError.desc
|
|
235
|
-
}
|
|
234
|
+
static createClientInfoDecodingError(caughtError) {
|
|
235
|
+
return new ClientAuthError(ClientAuthErrorMessage.clientInfoDecodingError.code, `${ClientAuthErrorMessage.clientInfoDecodingError.desc} Failed with error: ${caughtError}`);
|
|
236
|
+
}
|
|
236
237
|
/**
|
|
237
238
|
* Creates an error thrown if the client info is empty.
|
|
238
239
|
* @param rawClientInfo
|
|
239
240
|
*/
|
|
240
|
-
|
|
241
|
-
return new ClientAuthError(ClientAuthErrorMessage.clientInfoEmptyError.code,
|
|
242
|
-
}
|
|
241
|
+
static createClientInfoEmptyError() {
|
|
242
|
+
return new ClientAuthError(ClientAuthErrorMessage.clientInfoEmptyError.code, `${ClientAuthErrorMessage.clientInfoEmptyError.desc}`);
|
|
243
|
+
}
|
|
243
244
|
/**
|
|
244
245
|
* Creates an error thrown when the id token extraction errors out.
|
|
245
246
|
* @param err
|
|
246
247
|
*/
|
|
247
|
-
|
|
248
|
-
return new ClientAuthError(ClientAuthErrorMessage.tokenParsingError.code, ClientAuthErrorMessage.tokenParsingError.desc
|
|
249
|
-
}
|
|
248
|
+
static createTokenParsingError(caughtExtractionError) {
|
|
249
|
+
return new ClientAuthError(ClientAuthErrorMessage.tokenParsingError.code, `${ClientAuthErrorMessage.tokenParsingError.desc} Failed with error: ${caughtExtractionError}`);
|
|
250
|
+
}
|
|
250
251
|
/**
|
|
251
252
|
* Creates an error thrown when the id token string is null or empty.
|
|
252
253
|
* @param invalidRawTokenString
|
|
253
254
|
*/
|
|
254
|
-
|
|
255
|
-
return new ClientAuthError(ClientAuthErrorMessage.nullOrEmptyToken.code, ClientAuthErrorMessage.nullOrEmptyToken.desc
|
|
256
|
-
}
|
|
255
|
+
static createTokenNullOrEmptyError(invalidRawTokenString) {
|
|
256
|
+
return new ClientAuthError(ClientAuthErrorMessage.nullOrEmptyToken.code, `${ClientAuthErrorMessage.nullOrEmptyToken.desc} Raw Token Value: ${invalidRawTokenString}`);
|
|
257
|
+
}
|
|
257
258
|
/**
|
|
258
259
|
* Creates an error thrown when the endpoint discovery doesn't complete correctly.
|
|
259
260
|
*/
|
|
260
|
-
|
|
261
|
-
return new ClientAuthError(ClientAuthErrorMessage.endpointResolutionError.code, ClientAuthErrorMessage.endpointResolutionError.desc
|
|
262
|
-
}
|
|
261
|
+
static createEndpointDiscoveryIncompleteError(errDetail) {
|
|
262
|
+
return new ClientAuthError(ClientAuthErrorMessage.endpointResolutionError.code, `${ClientAuthErrorMessage.endpointResolutionError.desc} Detail: ${errDetail}`);
|
|
263
|
+
}
|
|
263
264
|
/**
|
|
264
265
|
* Creates an error thrown when the fetch client throws
|
|
265
266
|
*/
|
|
266
|
-
|
|
267
|
-
return new ClientAuthError(ClientAuthErrorMessage.networkError.code, ClientAuthErrorMessage.networkError.desc
|
|
268
|
-
}
|
|
267
|
+
static createNetworkError(endpoint, errDetail) {
|
|
268
|
+
return new ClientAuthError(ClientAuthErrorMessage.networkError.code, `${ClientAuthErrorMessage.networkError.desc} | Fetch client threw: ${errDetail} | Attempted to reach: ${endpoint.split("?")[0]}`);
|
|
269
|
+
}
|
|
269
270
|
/**
|
|
270
271
|
* Creates an error thrown when the openid-configuration endpoint cannot be reached or does not contain the required data
|
|
271
272
|
*/
|
|
272
|
-
|
|
273
|
-
return new ClientAuthError(ClientAuthErrorMessage.unableToGetOpenidConfigError.code, ClientAuthErrorMessage.unableToGetOpenidConfigError.desc
|
|
274
|
-
}
|
|
273
|
+
static createUnableToGetOpenidConfigError(errDetail) {
|
|
274
|
+
return new ClientAuthError(ClientAuthErrorMessage.unableToGetOpenidConfigError.code, `${ClientAuthErrorMessage.unableToGetOpenidConfigError.desc} Attempted to retrieve endpoints from: ${errDetail}`);
|
|
275
|
+
}
|
|
275
276
|
/**
|
|
276
277
|
* Creates an error thrown when the hash cannot be deserialized.
|
|
277
278
|
* @param hashParamObj
|
|
278
279
|
*/
|
|
279
|
-
|
|
280
|
-
return new ClientAuthError(ClientAuthErrorMessage.hashNotDeserialized.code, ClientAuthErrorMessage.hashNotDeserialized.desc
|
|
281
|
-
}
|
|
280
|
+
static createHashNotDeserializedError(hashParamObj) {
|
|
281
|
+
return new ClientAuthError(ClientAuthErrorMessage.hashNotDeserialized.code, `${ClientAuthErrorMessage.hashNotDeserialized.desc} Given Object: ${hashParamObj}`);
|
|
282
|
+
}
|
|
282
283
|
/**
|
|
283
284
|
* Creates an error thrown when the state cannot be parsed.
|
|
284
285
|
* @param invalidState
|
|
285
286
|
*/
|
|
286
|
-
|
|
287
|
-
return new ClientAuthError(ClientAuthErrorMessage.invalidStateError.code, ClientAuthErrorMessage.invalidStateError.desc
|
|
288
|
-
}
|
|
287
|
+
static createInvalidStateError(invalidState, errorString) {
|
|
288
|
+
return new ClientAuthError(ClientAuthErrorMessage.invalidStateError.code, `${ClientAuthErrorMessage.invalidStateError.desc} Invalid State: ${invalidState}, Root Err: ${errorString}`);
|
|
289
|
+
}
|
|
289
290
|
/**
|
|
290
291
|
* Creates an error thrown when two states do not match.
|
|
291
292
|
*/
|
|
292
|
-
|
|
293
|
+
static createStateMismatchError() {
|
|
293
294
|
return new ClientAuthError(ClientAuthErrorMessage.stateMismatchError.code, ClientAuthErrorMessage.stateMismatchError.desc);
|
|
294
|
-
}
|
|
295
|
+
}
|
|
295
296
|
/**
|
|
296
297
|
* Creates an error thrown when the state is not present
|
|
297
298
|
* @param missingState
|
|
298
299
|
*/
|
|
299
|
-
|
|
300
|
-
return new ClientAuthError(ClientAuthErrorMessage.stateNotFoundError.code, ClientAuthErrorMessage.stateNotFoundError.desc
|
|
301
|
-
}
|
|
300
|
+
static createStateNotFoundError(missingState) {
|
|
301
|
+
return new ClientAuthError(ClientAuthErrorMessage.stateNotFoundError.code, `${ClientAuthErrorMessage.stateNotFoundError.desc}: ${missingState}`);
|
|
302
|
+
}
|
|
302
303
|
/**
|
|
303
304
|
* Creates an error thrown when the nonce does not match.
|
|
304
305
|
*/
|
|
305
|
-
|
|
306
|
+
static createNonceMismatchError() {
|
|
306
307
|
return new ClientAuthError(ClientAuthErrorMessage.nonceMismatchError.code, ClientAuthErrorMessage.nonceMismatchError.desc);
|
|
307
|
-
}
|
|
308
|
+
}
|
|
308
309
|
/**
|
|
309
310
|
* Creates an error thrown when max_age was provided in the request, but auth_time is not in the token claims
|
|
310
311
|
* @param missingNonce
|
|
311
312
|
*/
|
|
312
|
-
|
|
313
|
+
static createAuthTimeNotFoundError() {
|
|
313
314
|
return new ClientAuthError(ClientAuthErrorMessage.authTimeNotFoundError.code, ClientAuthErrorMessage.authTimeNotFoundError.desc);
|
|
314
|
-
}
|
|
315
|
+
}
|
|
315
316
|
/**
|
|
316
317
|
* Creates an error thrown when too much time has elapsed since the last end-user authentication
|
|
317
318
|
*/
|
|
318
|
-
|
|
319
|
+
static createMaxAgeTranspiredError() {
|
|
319
320
|
return new ClientAuthError(ClientAuthErrorMessage.maxAgeTranspiredError.code, ClientAuthErrorMessage.maxAgeTranspiredError.desc);
|
|
320
|
-
}
|
|
321
|
+
}
|
|
321
322
|
/**
|
|
322
323
|
* Creates an error thrown when the mnonce is not present
|
|
323
324
|
* @param missingNonce
|
|
324
325
|
*/
|
|
325
|
-
|
|
326
|
-
return new ClientAuthError(ClientAuthErrorMessage.nonceNotFoundError.code, ClientAuthErrorMessage.nonceNotFoundError.desc
|
|
327
|
-
}
|
|
326
|
+
static createNonceNotFoundError(missingNonce) {
|
|
327
|
+
return new ClientAuthError(ClientAuthErrorMessage.nonceNotFoundError.code, `${ClientAuthErrorMessage.nonceNotFoundError.desc}: ${missingNonce}`);
|
|
328
|
+
}
|
|
328
329
|
/**
|
|
329
330
|
* Throws error when multiple tokens are in cache.
|
|
330
331
|
*/
|
|
331
|
-
|
|
332
|
-
return new ClientAuthError(ClientAuthErrorMessage.multipleMatchingTokens.code, ClientAuthErrorMessage.multipleMatchingTokens.desc
|
|
333
|
-
}
|
|
332
|
+
static createMultipleMatchingTokensInCacheError() {
|
|
333
|
+
return new ClientAuthError(ClientAuthErrorMessage.multipleMatchingTokens.code, `${ClientAuthErrorMessage.multipleMatchingTokens.desc}.`);
|
|
334
|
+
}
|
|
334
335
|
/**
|
|
335
336
|
* Throws error when multiple accounts are in cache for the given params
|
|
336
337
|
*/
|
|
337
|
-
|
|
338
|
+
static createMultipleMatchingAccountsInCacheError() {
|
|
338
339
|
return new ClientAuthError(ClientAuthErrorMessage.multipleMatchingAccounts.code, ClientAuthErrorMessage.multipleMatchingAccounts.desc);
|
|
339
|
-
}
|
|
340
|
+
}
|
|
340
341
|
/**
|
|
341
342
|
* Throws error when multiple appMetada are in cache for the given clientId.
|
|
342
343
|
*/
|
|
343
|
-
|
|
344
|
+
static createMultipleMatchingAppMetadataInCacheError() {
|
|
344
345
|
return new ClientAuthError(ClientAuthErrorMessage.multipleMatchingAppMetadata.code, ClientAuthErrorMessage.multipleMatchingAppMetadata.desc);
|
|
345
|
-
}
|
|
346
|
+
}
|
|
346
347
|
/**
|
|
347
348
|
* Throws error when no auth code or refresh token is given to ServerTokenRequestParameters.
|
|
348
349
|
*/
|
|
349
|
-
|
|
350
|
+
static createTokenRequestCannotBeMadeError() {
|
|
350
351
|
return new ClientAuthError(ClientAuthErrorMessage.tokenRequestCannotBeMade.code, ClientAuthErrorMessage.tokenRequestCannotBeMade.desc);
|
|
351
|
-
}
|
|
352
|
+
}
|
|
352
353
|
/**
|
|
353
354
|
* Throws error when attempting to append a null, undefined or empty scope to a set
|
|
354
355
|
* @param givenScope
|
|
355
356
|
*/
|
|
356
|
-
|
|
357
|
-
return new ClientAuthError(ClientAuthErrorMessage.appendEmptyScopeError.code, ClientAuthErrorMessage.appendEmptyScopeError.desc
|
|
358
|
-
}
|
|
357
|
+
static createAppendEmptyScopeToSetError(givenScope) {
|
|
358
|
+
return new ClientAuthError(ClientAuthErrorMessage.appendEmptyScopeError.code, `${ClientAuthErrorMessage.appendEmptyScopeError.desc} Given Scope: ${givenScope}`);
|
|
359
|
+
}
|
|
359
360
|
/**
|
|
360
361
|
* Throws error when attempting to append a null, undefined or empty scope to a set
|
|
361
362
|
* @param givenScope
|
|
362
363
|
*/
|
|
363
|
-
|
|
364
|
-
return new ClientAuthError(ClientAuthErrorMessage.removeEmptyScopeError.code, ClientAuthErrorMessage.removeEmptyScopeError.desc
|
|
365
|
-
}
|
|
364
|
+
static createRemoveEmptyScopeFromSetError(givenScope) {
|
|
365
|
+
return new ClientAuthError(ClientAuthErrorMessage.removeEmptyScopeError.code, `${ClientAuthErrorMessage.removeEmptyScopeError.desc} Given Scope: ${givenScope}`);
|
|
366
|
+
}
|
|
366
367
|
/**
|
|
367
368
|
* Throws error when attempting to append null or empty ScopeSet.
|
|
368
369
|
* @param appendError
|
|
369
370
|
*/
|
|
370
|
-
|
|
371
|
-
return new ClientAuthError(ClientAuthErrorMessage.appendScopeSetError.code, ClientAuthErrorMessage.appendScopeSetError.desc
|
|
372
|
-
}
|
|
371
|
+
static createAppendScopeSetError(appendError) {
|
|
372
|
+
return new ClientAuthError(ClientAuthErrorMessage.appendScopeSetError.code, `${ClientAuthErrorMessage.appendScopeSetError.desc} Detail Error: ${appendError}`);
|
|
373
|
+
}
|
|
373
374
|
/**
|
|
374
375
|
* Throws error if ScopeSet is null or undefined.
|
|
375
376
|
* @param givenScopeSet
|
|
376
377
|
*/
|
|
377
|
-
|
|
378
|
-
return new ClientAuthError(ClientAuthErrorMessage.emptyInputScopeSetError.code,
|
|
379
|
-
}
|
|
378
|
+
static createEmptyInputScopeSetError() {
|
|
379
|
+
return new ClientAuthError(ClientAuthErrorMessage.emptyInputScopeSetError.code, `${ClientAuthErrorMessage.emptyInputScopeSetError.desc}`);
|
|
380
|
+
}
|
|
380
381
|
/**
|
|
381
382
|
* Throws error if user sets CancellationToken.cancel = true during polling of token endpoint during device code flow
|
|
382
383
|
*/
|
|
383
|
-
|
|
384
|
-
return new ClientAuthError(ClientAuthErrorMessage.DeviceCodePollingCancelled.code,
|
|
385
|
-
}
|
|
384
|
+
static createDeviceCodeCancelledError() {
|
|
385
|
+
return new ClientAuthError(ClientAuthErrorMessage.DeviceCodePollingCancelled.code, `${ClientAuthErrorMessage.DeviceCodePollingCancelled.desc}`);
|
|
386
|
+
}
|
|
386
387
|
/**
|
|
387
388
|
* Throws error if device code is expired
|
|
388
389
|
*/
|
|
389
|
-
|
|
390
|
-
return new ClientAuthError(ClientAuthErrorMessage.DeviceCodeExpired.code,
|
|
391
|
-
}
|
|
390
|
+
static createDeviceCodeExpiredError() {
|
|
391
|
+
return new ClientAuthError(ClientAuthErrorMessage.DeviceCodeExpired.code, `${ClientAuthErrorMessage.DeviceCodeExpired.desc}`);
|
|
392
|
+
}
|
|
392
393
|
/**
|
|
393
394
|
* Throws error if device code is expired
|
|
394
395
|
*/
|
|
395
|
-
|
|
396
|
-
return new ClientAuthError(ClientAuthErrorMessage.DeviceCodeUnknownError.code,
|
|
397
|
-
}
|
|
396
|
+
static createDeviceCodeUnknownError() {
|
|
397
|
+
return new ClientAuthError(ClientAuthErrorMessage.DeviceCodeUnknownError.code, `${ClientAuthErrorMessage.DeviceCodeUnknownError.desc}`);
|
|
398
|
+
}
|
|
398
399
|
/**
|
|
399
400
|
* Throws error when silent requests are made without an account object
|
|
400
401
|
*/
|
|
401
|
-
|
|
402
|
-
return new ClientAuthError(ClientAuthErrorMessage.NoAccountInSilentRequest.code,
|
|
403
|
-
}
|
|
402
|
+
static createNoAccountInSilentRequestError() {
|
|
403
|
+
return new ClientAuthError(ClientAuthErrorMessage.NoAccountInSilentRequest.code, `${ClientAuthErrorMessage.NoAccountInSilentRequest.desc}`);
|
|
404
|
+
}
|
|
404
405
|
/**
|
|
405
406
|
* Throws error when cache record is null or undefined.
|
|
406
407
|
*/
|
|
407
|
-
|
|
408
|
+
static createNullOrUndefinedCacheRecord() {
|
|
408
409
|
return new ClientAuthError(ClientAuthErrorMessage.invalidCacheRecord.code, ClientAuthErrorMessage.invalidCacheRecord.desc);
|
|
409
|
-
}
|
|
410
|
+
}
|
|
410
411
|
/**
|
|
411
412
|
* Throws error when provided environment is not part of the CloudDiscoveryMetadata object
|
|
412
413
|
*/
|
|
413
|
-
|
|
414
|
+
static createInvalidCacheEnvironmentError() {
|
|
414
415
|
return new ClientAuthError(ClientAuthErrorMessage.invalidCacheEnvironment.code, ClientAuthErrorMessage.invalidCacheEnvironment.desc);
|
|
415
|
-
}
|
|
416
|
+
}
|
|
416
417
|
/**
|
|
417
418
|
* Throws error when account is not found in cache.
|
|
418
419
|
*/
|
|
419
|
-
|
|
420
|
+
static createNoAccountFoundError() {
|
|
420
421
|
return new ClientAuthError(ClientAuthErrorMessage.noAccountFound.code, ClientAuthErrorMessage.noAccountFound.desc);
|
|
421
|
-
}
|
|
422
|
+
}
|
|
422
423
|
/**
|
|
423
424
|
* Throws error if ICachePlugin not set on CacheManager.
|
|
424
425
|
*/
|
|
425
|
-
|
|
426
|
-
return new ClientAuthError(ClientAuthErrorMessage.CachePluginError.code,
|
|
427
|
-
}
|
|
426
|
+
static createCachePluginError() {
|
|
427
|
+
return new ClientAuthError(ClientAuthErrorMessage.CachePluginError.code, `${ClientAuthErrorMessage.CachePluginError.desc}`);
|
|
428
|
+
}
|
|
428
429
|
/**
|
|
429
430
|
* Throws error if crypto object not found.
|
|
430
431
|
* @param operationName
|
|
431
432
|
*/
|
|
432
|
-
|
|
433
|
-
return new ClientAuthError(ClientAuthErrorMessage.noCryptoObj.code,
|
|
434
|
-
}
|
|
433
|
+
static createNoCryptoObjectError(operationName) {
|
|
434
|
+
return new ClientAuthError(ClientAuthErrorMessage.noCryptoObj.code, `${ClientAuthErrorMessage.noCryptoObj.desc}${operationName}`);
|
|
435
|
+
}
|
|
435
436
|
/**
|
|
436
437
|
* Throws error if cache type is invalid.
|
|
437
438
|
*/
|
|
438
|
-
|
|
439
|
-
return new ClientAuthError(ClientAuthErrorMessage.invalidCacheType.code,
|
|
440
|
-
}
|
|
439
|
+
static createInvalidCacheTypeError() {
|
|
440
|
+
return new ClientAuthError(ClientAuthErrorMessage.invalidCacheType.code, `${ClientAuthErrorMessage.invalidCacheType.desc}`);
|
|
441
|
+
}
|
|
441
442
|
/**
|
|
442
443
|
* Throws error if unexpected account type.
|
|
443
444
|
*/
|
|
444
|
-
|
|
445
|
-
return new ClientAuthError(ClientAuthErrorMessage.unexpectedAccountType.code,
|
|
446
|
-
}
|
|
445
|
+
static createUnexpectedAccountTypeError() {
|
|
446
|
+
return new ClientAuthError(ClientAuthErrorMessage.unexpectedAccountType.code, `${ClientAuthErrorMessage.unexpectedAccountType.desc}`);
|
|
447
|
+
}
|
|
447
448
|
/**
|
|
448
449
|
* Throws error if unexpected credential type.
|
|
449
450
|
*/
|
|
450
|
-
|
|
451
|
-
return new ClientAuthError(ClientAuthErrorMessage.unexpectedCredentialType.code,
|
|
452
|
-
}
|
|
451
|
+
static createUnexpectedCredentialTypeError() {
|
|
452
|
+
return new ClientAuthError(ClientAuthErrorMessage.unexpectedCredentialType.code, `${ClientAuthErrorMessage.unexpectedCredentialType.desc}`);
|
|
453
|
+
}
|
|
453
454
|
/**
|
|
454
455
|
* Throws error if client assertion is not valid.
|
|
455
456
|
*/
|
|
456
|
-
|
|
457
|
-
return new ClientAuthError(ClientAuthErrorMessage.invalidAssertion.code,
|
|
458
|
-
}
|
|
457
|
+
static createInvalidAssertionError() {
|
|
458
|
+
return new ClientAuthError(ClientAuthErrorMessage.invalidAssertion.code, `${ClientAuthErrorMessage.invalidAssertion.desc}`);
|
|
459
|
+
}
|
|
459
460
|
/**
|
|
460
461
|
* Throws error if client assertion is not valid.
|
|
461
462
|
*/
|
|
462
|
-
|
|
463
|
-
return new ClientAuthError(ClientAuthErrorMessage.invalidClientCredential.code,
|
|
464
|
-
}
|
|
463
|
+
static createInvalidCredentialError() {
|
|
464
|
+
return new ClientAuthError(ClientAuthErrorMessage.invalidClientCredential.code, `${ClientAuthErrorMessage.invalidClientCredential.desc}`);
|
|
465
|
+
}
|
|
465
466
|
/**
|
|
466
467
|
* Throws error if token cannot be retrieved from cache due to refresh being required.
|
|
467
468
|
*/
|
|
468
|
-
|
|
469
|
+
static createRefreshRequiredError() {
|
|
469
470
|
return new ClientAuthError(ClientAuthErrorMessage.tokenRefreshRequired.code, ClientAuthErrorMessage.tokenRefreshRequired.desc);
|
|
470
|
-
}
|
|
471
|
+
}
|
|
471
472
|
/**
|
|
472
473
|
* Throws error if the user defined timeout is reached.
|
|
473
474
|
*/
|
|
474
|
-
|
|
475
|
+
static createUserTimeoutReachedError() {
|
|
475
476
|
return new ClientAuthError(ClientAuthErrorMessage.userTimeoutReached.code, ClientAuthErrorMessage.userTimeoutReached.desc);
|
|
476
|
-
}
|
|
477
|
+
}
|
|
477
478
|
/*
|
|
478
479
|
* Throws error if token claims are not populated for a signed jwt generation
|
|
479
480
|
*/
|
|
480
|
-
|
|
481
|
+
static createTokenClaimsRequiredError() {
|
|
481
482
|
return new ClientAuthError(ClientAuthErrorMessage.tokenClaimsRequired.code, ClientAuthErrorMessage.tokenClaimsRequired.desc);
|
|
482
|
-
}
|
|
483
|
+
}
|
|
483
484
|
/**
|
|
484
485
|
* Throws error when the authorization code is missing from the server response
|
|
485
486
|
*/
|
|
486
|
-
|
|
487
|
+
static createNoAuthCodeInServerResponseError() {
|
|
487
488
|
return new ClientAuthError(ClientAuthErrorMessage.noAuthorizationCodeFromServer.code, ClientAuthErrorMessage.noAuthorizationCodeFromServer.desc);
|
|
488
|
-
}
|
|
489
|
-
|
|
489
|
+
}
|
|
490
|
+
static createBindingKeyNotRemovedError() {
|
|
490
491
|
return new ClientAuthError(ClientAuthErrorMessage.bindingKeyNotRemovedError.code, ClientAuthErrorMessage.bindingKeyNotRemovedError.desc);
|
|
491
|
-
}
|
|
492
|
+
}
|
|
492
493
|
/**
|
|
493
494
|
* Thrown when logout is attempted for an authority that doesnt have an end_session_endpoint
|
|
494
495
|
*/
|
|
495
|
-
|
|
496
|
+
static createLogoutNotSupportedError() {
|
|
496
497
|
return new ClientAuthError(ClientAuthErrorMessage.logoutNotSupported.code, ClientAuthErrorMessage.logoutNotSupported.desc);
|
|
497
|
-
}
|
|
498
|
+
}
|
|
498
499
|
/**
|
|
499
500
|
* Create an error when kid attribute is missing from a PoP token's cache record
|
|
500
501
|
*/
|
|
501
|
-
|
|
502
|
+
static createKeyIdMissingError() {
|
|
502
503
|
return new ClientAuthError(ClientAuthErrorMessage.keyIdMissing.code, ClientAuthErrorMessage.keyIdMissing.desc);
|
|
503
|
-
}
|
|
504
|
+
}
|
|
504
505
|
/**
|
|
505
506
|
* Create an error when the client does not have network connectivity
|
|
506
507
|
*/
|
|
507
|
-
|
|
508
|
+
static createNoNetworkConnectivityError() {
|
|
508
509
|
return new ClientAuthError(ClientAuthErrorMessage.noNetworkConnectivity.code, ClientAuthErrorMessage.noNetworkConnectivity.desc);
|
|
509
|
-
}
|
|
510
|
+
}
|
|
510
511
|
/**
|
|
511
512
|
* Create an error when the user cancels the flow
|
|
512
513
|
*/
|
|
513
|
-
|
|
514
|
+
static createUserCanceledError() {
|
|
514
515
|
return new ClientAuthError(ClientAuthErrorMessage.userCanceledError.code, ClientAuthErrorMessage.userCanceledError.desc);
|
|
515
|
-
}
|
|
516
|
-
|
|
517
|
-
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* Creates an error for during acquireTokenByClientCredential when TenantId is set to "common" or "organizations"
|
|
519
|
+
*/
|
|
520
|
+
static createMissingTenantIdError() {
|
|
521
|
+
return new AuthError(ClientAuthErrorMessage.missingTenantIdError.code, ClientAuthErrorMessage.missingTenantIdError.desc);
|
|
522
|
+
}
|
|
523
|
+
}
|
|
518
524
|
|
|
519
525
|
export { ClientAuthError, ClientAuthErrorMessage };
|
|
520
526
|
//# sourceMappingURL=ClientAuthError.js.map
|