@azure/msal-common 14.0.3 → 14.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/account/AccountInfo.d.ts +0 -1
- package/dist/account/AccountInfo.d.ts.map +1 -1
- package/dist/account/AuthToken.d.ts.map +1 -1
- package/dist/account/AuthToken.mjs +7 -6
- package/dist/account/AuthToken.mjs.map +1 -1
- package/dist/account/CcsCredential.mjs +1 -1
- package/dist/account/ClientInfo.d.ts.map +1 -1
- package/dist/account/ClientInfo.mjs +6 -5
- package/dist/account/ClientInfo.mjs.map +1 -1
- package/dist/authority/Authority.d.ts.map +1 -1
- package/dist/authority/Authority.mjs +28 -50
- package/dist/authority/Authority.mjs.map +1 -1
- package/dist/authority/AuthorityFactory.d.ts.map +1 -1
- package/dist/authority/AuthorityFactory.mjs +9 -7
- package/dist/authority/AuthorityFactory.mjs.map +1 -1
- package/dist/authority/AuthorityMetadata.mjs +1 -1
- package/dist/authority/AuthorityOptions.mjs +1 -1
- package/dist/authority/AuthorityType.mjs +1 -1
- package/dist/authority/CloudInstanceDiscoveryErrorResponse.mjs +1 -1
- package/dist/authority/CloudInstanceDiscoveryResponse.mjs +1 -1
- package/dist/authority/OpenIdConfigResponse.mjs +1 -1
- package/dist/authority/ProtocolMode.mjs +1 -1
- package/dist/authority/RegionDiscovery.d.ts +3 -1
- package/dist/authority/RegionDiscovery.d.ts.map +1 -1
- package/dist/authority/RegionDiscovery.mjs +7 -8
- package/dist/authority/RegionDiscovery.mjs.map +1 -1
- package/dist/cache/CacheManager.d.ts +25 -7
- package/dist/cache/CacheManager.d.ts.map +1 -1
- package/dist/cache/CacheManager.mjs +98 -71
- package/dist/cache/CacheManager.mjs.map +1 -1
- package/dist/cache/entities/AccessTokenEntity.d.ts.map +1 -1
- package/dist/cache/entities/AccessTokenEntity.mjs +4 -3
- package/dist/cache/entities/AccessTokenEntity.mjs.map +1 -1
- package/dist/cache/entities/AccountEntity.d.ts.map +1 -1
- package/dist/cache/entities/AccountEntity.mjs +4 -3
- package/dist/cache/entities/AccountEntity.mjs.map +1 -1
- package/dist/cache/entities/AppMetadataEntity.mjs +1 -1
- package/dist/cache/entities/AuthorityMetadataEntity.mjs +1 -1
- package/dist/cache/entities/CacheRecord.mjs +1 -1
- package/dist/cache/entities/CredentialEntity.d.ts.map +1 -1
- package/dist/cache/entities/CredentialEntity.mjs +4 -3
- package/dist/cache/entities/CredentialEntity.mjs.map +1 -1
- package/dist/cache/entities/IdTokenEntity.mjs +1 -1
- package/dist/cache/entities/RefreshTokenEntity.mjs +1 -1
- package/dist/cache/entities/ServerTelemetryEntity.mjs +1 -1
- package/dist/cache/entities/ThrottlingEntity.mjs +1 -1
- package/dist/cache/persistence/TokenCacheContext.mjs +1 -1
- package/dist/cache/utils/CacheTypes.d.ts +3 -6
- package/dist/cache/utils/CacheTypes.d.ts.map +1 -1
- package/dist/client/AuthorizationCodeClient.d.ts.map +1 -1
- package/dist/client/AuthorizationCodeClient.mjs +13 -11
- package/dist/client/AuthorizationCodeClient.mjs.map +1 -1
- package/dist/client/BaseClient.d.ts.map +1 -1
- package/dist/client/BaseClient.mjs +5 -4
- package/dist/client/BaseClient.mjs.map +1 -1
- package/dist/client/RefreshTokenClient.d.ts.map +1 -1
- package/dist/client/RefreshTokenClient.mjs +33 -74
- package/dist/client/RefreshTokenClient.mjs.map +1 -1
- package/dist/client/SilentFlowClient.d.ts +2 -1
- package/dist/client/SilentFlowClient.d.ts.map +1 -1
- package/dist/client/SilentFlowClient.mjs +43 -19
- package/dist/client/SilentFlowClient.mjs.map +1 -1
- package/dist/config/ClientConfiguration.d.ts.map +1 -1
- package/dist/config/ClientConfiguration.mjs +5 -6
- package/dist/config/ClientConfiguration.mjs.map +1 -1
- package/dist/crypto/ICrypto.d.ts +0 -4
- package/dist/crypto/ICrypto.d.ts.map +1 -1
- package/dist/crypto/ICrypto.mjs +11 -22
- package/dist/crypto/ICrypto.mjs.map +1 -1
- package/dist/crypto/JoseHeader.d.ts.map +1 -1
- package/dist/crypto/JoseHeader.mjs +5 -4
- package/dist/crypto/JoseHeader.mjs.map +1 -1
- package/dist/crypto/PopTokenGenerator.d.ts +2 -1
- package/dist/crypto/PopTokenGenerator.d.ts.map +1 -1
- package/dist/crypto/PopTokenGenerator.mjs +4 -4
- package/dist/crypto/PopTokenGenerator.mjs.map +1 -1
- package/dist/error/AuthError.d.ts +8 -11
- package/dist/error/AuthError.d.ts.map +1 -1
- package/dist/error/AuthError.mjs +19 -21
- package/dist/error/AuthError.mjs.map +1 -1
- package/dist/error/AuthErrorCodes.d.ts +6 -0
- package/dist/error/AuthErrorCodes.d.ts.map +1 -0
- package/dist/error/AuthErrorCodes.mjs +14 -0
- package/dist/error/AuthErrorCodes.mjs.map +1 -0
- package/dist/error/ClientAuthError.d.ts +54 -234
- package/dist/error/ClientAuthError.d.ts.map +1 -1
- package/dist/error/ClientAuthError.mjs +149 -421
- package/dist/error/ClientAuthError.mjs.map +1 -1
- package/dist/error/ClientAuthErrorCodes.d.ts +44 -0
- package/dist/error/ClientAuthErrorCodes.d.ts.map +1 -0
- package/dist/error/ClientAuthErrorCodes.mjs +52 -0
- package/dist/error/ClientAuthErrorCodes.mjs.map +1 -0
- package/dist/error/ClientConfigurationError.d.ts +31 -125
- package/dist/error/ClientConfigurationError.d.ts.map +1 -1
- package/dist/error/ClientConfigurationError.mjs +81 -222
- package/dist/error/ClientConfigurationError.mjs.map +1 -1
- package/dist/error/ClientConfigurationErrorCodes.d.ts +23 -0
- package/dist/error/ClientConfigurationErrorCodes.d.ts.map +1 -0
- package/dist/error/ClientConfigurationErrorCodes.mjs +31 -0
- package/dist/error/ClientConfigurationErrorCodes.mjs.map +1 -0
- package/dist/error/InteractionRequiredAuthError.d.ts +14 -16
- package/dist/error/InteractionRequiredAuthError.d.ts.map +1 -1
- package/dist/error/InteractionRequiredAuthError.mjs +42 -41
- package/dist/error/InteractionRequiredAuthError.mjs.map +1 -1
- package/dist/error/InteractionRequiredAuthErrorCodes.d.ts +6 -0
- package/dist/error/InteractionRequiredAuthErrorCodes.d.ts.map +1 -0
- package/dist/error/InteractionRequiredAuthErrorCodes.mjs +16 -0
- package/dist/error/InteractionRequiredAuthErrorCodes.mjs.map +1 -0
- package/dist/error/JoseHeaderError.d.ts +7 -20
- package/dist/error/JoseHeaderError.d.ts.map +1 -1
- package/dist/error/JoseHeaderError.mjs +10 -26
- package/dist/error/JoseHeaderError.mjs.map +1 -1
- package/dist/error/JoseHeaderErrorCodes.d.ts +3 -0
- package/dist/error/JoseHeaderErrorCodes.d.ts.map +1 -0
- package/dist/error/JoseHeaderErrorCodes.mjs +11 -0
- package/dist/error/JoseHeaderErrorCodes.mjs.map +1 -0
- package/dist/error/ServerError.mjs +1 -1
- package/dist/index.cjs +942 -1210
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +13 -5
- package/dist/index.mjs.map +1 -1
- package/dist/logger/Logger.mjs +1 -1
- package/dist/network/INetworkModule.d.ts.map +1 -1
- package/dist/network/INetworkModule.mjs +5 -6
- package/dist/network/INetworkModule.mjs.map +1 -1
- package/dist/network/NetworkManager.d.ts.map +1 -1
- package/dist/network/NetworkManager.mjs +4 -3
- package/dist/network/NetworkManager.mjs.map +1 -1
- package/dist/network/ThrottlingUtils.mjs +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/request/AuthenticationHeaderParser.d.ts.map +1 -1
- package/dist/request/AuthenticationHeaderParser.mjs +7 -6
- package/dist/request/AuthenticationHeaderParser.mjs.map +1 -1
- package/dist/request/CommonRefreshTokenRequest.d.ts +3 -0
- package/dist/request/CommonRefreshTokenRequest.d.ts.map +1 -1
- package/dist/request/CommonSilentFlowRequest.d.ts +2 -0
- package/dist/request/CommonSilentFlowRequest.d.ts.map +1 -1
- package/dist/request/RequestParameterBuilder.d.ts.map +1 -1
- package/dist/request/RequestParameterBuilder.mjs +5 -4
- package/dist/request/RequestParameterBuilder.mjs.map +1 -1
- package/dist/request/RequestValidator.d.ts.map +1 -1
- package/dist/request/RequestValidator.mjs +8 -7
- package/dist/request/RequestValidator.mjs.map +1 -1
- package/dist/request/ScopeSet.d.ts.map +1 -1
- package/dist/request/ScopeSet.mjs +10 -8
- package/dist/request/ScopeSet.mjs.map +1 -1
- package/dist/response/ResponseHandler.d.ts.map +1 -1
- package/dist/response/ResponseHandler.mjs +15 -14
- package/dist/response/ResponseHandler.mjs.map +1 -1
- package/dist/telemetry/performance/PerformanceClient.d.ts.map +1 -1
- package/dist/telemetry/performance/PerformanceClient.mjs +3 -2
- package/dist/telemetry/performance/PerformanceClient.mjs.map +1 -1
- package/dist/telemetry/performance/PerformanceEvent.d.ts +8 -0
- package/dist/telemetry/performance/PerformanceEvent.d.ts.map +1 -1
- package/dist/telemetry/performance/PerformanceEvent.mjs +9 -1
- package/dist/telemetry/performance/PerformanceEvent.mjs.map +1 -1
- package/dist/telemetry/performance/StubPerformanceClient.mjs +1 -1
- package/dist/telemetry/server/ServerTelemetryManager.d.ts.map +1 -1
- package/dist/telemetry/server/ServerTelemetryManager.mjs +2 -2
- package/dist/telemetry/server/ServerTelemetryManager.mjs.map +1 -1
- package/dist/url/UrlString.d.ts.map +1 -1
- package/dist/url/UrlString.mjs +13 -11
- package/dist/url/UrlString.mjs.map +1 -1
- package/dist/utils/Constants.d.ts +6 -3
- package/dist/utils/Constants.d.ts.map +1 -1
- package/dist/utils/Constants.mjs +12 -4
- package/dist/utils/Constants.mjs.map +1 -1
- package/dist/utils/FunctionWrappers.d.ts.map +1 -1
- package/dist/utils/FunctionWrappers.mjs +1 -2
- package/dist/utils/FunctionWrappers.mjs.map +1 -1
- package/dist/utils/ProtocolUtils.d.ts.map +1 -1
- package/dist/utils/ProtocolUtils.mjs +7 -6
- package/dist/utils/ProtocolUtils.mjs.map +1 -1
- package/dist/utils/StringUtils.mjs +1 -1
- package/dist/utils/TimeUtils.mjs +1 -1
- package/package.json +1 -1
- package/src/account/AccountInfo.ts +0 -1
- package/src/account/AuthToken.ts +8 -7
- package/src/account/ClientInfo.ts +9 -6
- package/src/authority/Authority.ts +76 -94
- package/src/authority/AuthorityFactory.ts +21 -9
- package/src/authority/RegionDiscovery.ts +21 -18
- package/src/cache/CacheManager.ts +133 -95
- package/src/cache/entities/AccessTokenEntity.ts +7 -2
- package/src/cache/entities/AccountEntity.ts +7 -2
- package/src/cache/entities/CredentialEntity.ts +7 -2
- package/src/cache/utils/CacheTypes.ts +6 -6
- package/src/client/AuthorizationCodeClient.ts +35 -11
- package/src/client/BaseClient.ts +7 -4
- package/src/client/RefreshTokenClient.ts +100 -126
- package/src/client/SilentFlowClient.ts +72 -19
- package/src/config/ClientConfiguration.ts +6 -7
- package/src/crypto/ICrypto.ts +12 -34
- package/src/crypto/JoseHeader.ts +6 -3
- package/src/crypto/PopTokenGenerator.ts +10 -5
- package/src/error/AuthError.ts +24 -26
- package/src/error/AuthErrorCodes.ts +10 -0
- package/src/error/ClientAuthError.ts +227 -632
- package/src/error/ClientAuthErrorCodes.ts +51 -0
- package/src/error/ClientConfigurationError.ts +146 -332
- package/src/error/ClientConfigurationErrorCodes.ts +28 -0
- package/src/error/InteractionRequiredAuthError.ts +60 -55
- package/src/error/InteractionRequiredAuthErrorCodes.ts +13 -0
- package/src/error/JoseHeaderError.ts +11 -31
- package/src/error/JoseHeaderErrorCodes.ts +7 -0
- package/src/index.ts +13 -1
- package/src/network/INetworkModule.ts +10 -7
- package/src/network/NetworkManager.ts +5 -5
- package/src/packageMetadata.ts +1 -1
- package/src/request/AuthenticationHeaderParser.ts +11 -8
- package/src/request/CommonRefreshTokenRequest.ts +3 -0
- package/src/request/CommonSilentFlowRequest.ts +2 -0
- package/src/request/RequestParameterBuilder.ts +10 -3
- package/src/request/RequestValidator.ts +19 -6
- package/src/request/ScopeSet.ts +23 -7
- package/src/response/ResponseHandler.ts +37 -17
- package/src/telemetry/performance/PerformanceClient.ts +2 -1
- package/src/telemetry/performance/PerformanceEvent.ts +9 -0
- package/src/telemetry/server/ServerTelemetryManager.ts +1 -1
- package/src/url/UrlString.ts +26 -16
- package/src/utils/Constants.ts +11 -3
- package/src/utils/FunctionWrappers.ts +0 -1
- package/src/utils/ProtocolUtils.ts +8 -12
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export const clientInfoDecodingError = "client_info_decoding_error";
|
|
7
|
+
export const clientInfoEmptyError = "client_info_empty_error";
|
|
8
|
+
export const tokenParsingError = "token_parsing_error";
|
|
9
|
+
export const nullOrEmptyToken = "null_or_empty_token";
|
|
10
|
+
export const endpointResolutionError = "endpoints_resolution_error";
|
|
11
|
+
export const networkError = "network_error";
|
|
12
|
+
export const openIdConfigError = "openid_config_error";
|
|
13
|
+
export const hashNotDeserialized = "hash_not_deserialized";
|
|
14
|
+
export const invalidState = "invalid_state";
|
|
15
|
+
export const stateMismatch = "state_mismatch";
|
|
16
|
+
export const stateNotFound = "state_not_found";
|
|
17
|
+
export const nonceMismatch = "nonce_mismatch";
|
|
18
|
+
export const authTimeNotFound = "auth_time_not_found";
|
|
19
|
+
export const maxAgeTranspired = "max_age_transpired";
|
|
20
|
+
export const multipleMatchingTokens = "multiple_matching_tokens";
|
|
21
|
+
export const multipleMatchingAccounts = "multiple_matching_accounts";
|
|
22
|
+
export const multipleMatchingAppMetadata = "multiple_matching_appMetadata";
|
|
23
|
+
export const requestCannotBeMade = "request_cannot_be_made";
|
|
24
|
+
export const cannotRemoveEmptyScope = "cannot_remove_empty_scope";
|
|
25
|
+
export const cannotAppendScopeSet = "cannot_append_scopeset";
|
|
26
|
+
export const emptyInputScopeSet = "empty_input_scopeset";
|
|
27
|
+
export const deviceCodePollingCancelled = "device_code_polling_cancelled";
|
|
28
|
+
export const deviceCodeExpired = "device_code_expired";
|
|
29
|
+
export const deviceCodeUnknownError = "device_code_unknown_error";
|
|
30
|
+
export const noAccountInSilentRequest = "no_account_in_silent_request";
|
|
31
|
+
export const invalidCacheRecord = "invalid_cache_record";
|
|
32
|
+
export const invalidCacheEnvironment = "invalid_cache_environment";
|
|
33
|
+
export const noAccountFound = "no_account_found";
|
|
34
|
+
export const noCryptoObject = "no_crypto_object";
|
|
35
|
+
export const unexpectedCredentialType = "unexpected_credential_type";
|
|
36
|
+
export const invalidAssertion = "invalid_assertion";
|
|
37
|
+
export const invalidClientCredential = "invalid_client_credential";
|
|
38
|
+
export const tokenRefreshRequired = "token_refresh_required";
|
|
39
|
+
export const userTimeoutReached = "user_timeout_reached";
|
|
40
|
+
export const tokenClaimsCnfRequiredForSignedJwt =
|
|
41
|
+
"token_claims_cnf_required_for_signedjwt";
|
|
42
|
+
export const authorizationCodeMissingFromServerResponse =
|
|
43
|
+
"authorization_code_missing_from_server_response";
|
|
44
|
+
export const bindingKeyNotRemoved = "binding_key_not_removed";
|
|
45
|
+
export const endSessionEndpointNotSupported =
|
|
46
|
+
"end_session_endpoint_not_supported";
|
|
47
|
+
export const keyIdMissing = "key_id_missing";
|
|
48
|
+
export const noNetworkConnectivity = "no_network_connectivity";
|
|
49
|
+
export const userCanceled = "user_canceled";
|
|
50
|
+
export const missingTenantIdError = "missing_tenant_id_error";
|
|
51
|
+
export const methodNotImplemented = "method_not_implemented";
|
|
@@ -3,394 +3,208 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { AuthError } from "./AuthError";
|
|
7
|
+
import * as ClientConfigurationErrorCodes from "./ClientConfigurationErrorCodes";
|
|
8
|
+
export { ClientConfigurationErrorCodes };
|
|
9
|
+
|
|
10
|
+
export const ClientConfigurationErrorMessages = {
|
|
11
|
+
[ClientConfigurationErrorCodes.redirectUriEmpty]:
|
|
12
|
+
"A redirect URI is required for all calls, and none has been set.",
|
|
13
|
+
[ClientConfigurationErrorCodes.claimsRequestParsingError]:
|
|
14
|
+
"Could not parse the given claims request object.",
|
|
15
|
+
[ClientConfigurationErrorCodes.authorityUriInsecure]:
|
|
16
|
+
"Authority URIs must use https. Please see here for valid authority configuration options: https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-js-initializing-client-applications#configuration-options",
|
|
17
|
+
[ClientConfigurationErrorCodes.urlParseError]:
|
|
18
|
+
"URL could not be parsed into appropriate segments.",
|
|
19
|
+
[ClientConfigurationErrorCodes.urlEmptyError]: "URL was empty or null.",
|
|
20
|
+
[ClientConfigurationErrorCodes.emptyInputScopesError]:
|
|
21
|
+
"Scopes cannot be passed as null, undefined or empty array because they are required to obtain an access token.",
|
|
22
|
+
[ClientConfigurationErrorCodes.invalidPromptValue]:
|
|
23
|
+
"Please see here for valid configuration options: https://azuread.github.io/microsoft-authentication-library-for-js/ref/modules/_azure_msal_common.html#commonauthorizationurlrequest",
|
|
24
|
+
[ClientConfigurationErrorCodes.invalidClaims]:
|
|
25
|
+
"Given claims parameter must be a stringified JSON object.",
|
|
26
|
+
[ClientConfigurationErrorCodes.tokenRequestEmpty]:
|
|
27
|
+
"Token request was empty and not found in cache.",
|
|
28
|
+
[ClientConfigurationErrorCodes.logoutRequestEmpty]:
|
|
29
|
+
"The logout request was null or undefined.",
|
|
30
|
+
[ClientConfigurationErrorCodes.invalidCodeChallengeMethod]:
|
|
31
|
+
'code_challenge_method passed is invalid. Valid values are "plain" and "S256".',
|
|
32
|
+
[ClientConfigurationErrorCodes.pkceParamsMissing]:
|
|
33
|
+
"Both params: code_challenge and code_challenge_method are to be passed if to be sent in the request",
|
|
34
|
+
[ClientConfigurationErrorCodes.invalidCloudDiscoveryMetadata]:
|
|
35
|
+
"Invalid cloudDiscoveryMetadata provided. Must be a stringified JSON object containing tenant_discovery_endpoint and metadata fields",
|
|
36
|
+
[ClientConfigurationErrorCodes.invalidAuthorityMetadata]:
|
|
37
|
+
"Invalid authorityMetadata provided. Must by a stringified JSON object containing authorization_endpoint, token_endpoint, issuer fields.",
|
|
38
|
+
[ClientConfigurationErrorCodes.untrustedAuthority]:
|
|
39
|
+
"The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter.",
|
|
40
|
+
[ClientConfigurationErrorCodes.missingSshJwk]:
|
|
41
|
+
"Missing sshJwk in SSH certificate request. A stringified JSON Web Key is required when using the SSH authentication scheme.",
|
|
42
|
+
[ClientConfigurationErrorCodes.missingSshKid]:
|
|
43
|
+
"Missing sshKid in SSH certificate request. A string that uniquely identifies the public SSH key is required when using the SSH authentication scheme.",
|
|
44
|
+
[ClientConfigurationErrorCodes.missingNonceAuthenticationHeader]:
|
|
45
|
+
"Unable to find an authentication header containing server nonce. Either the Authentication-Info or WWW-Authenticate headers must be present in order to obtain a server nonce.",
|
|
46
|
+
[ClientConfigurationErrorCodes.invalidAuthenticationHeader]:
|
|
47
|
+
"Invalid authentication header provided",
|
|
48
|
+
[ClientConfigurationErrorCodes.cannotSetOIDCOptions]:
|
|
49
|
+
"Cannot set OIDCOptions parameter. Please change the protocol mode to OIDC or use a non-Microsoft authority.",
|
|
50
|
+
[ClientConfigurationErrorCodes.cannotAllowNativeBroker]:
|
|
51
|
+
"Cannot set allowNativeBroker parameter to true when not in AAD protocol mode.",
|
|
52
|
+
[ClientConfigurationErrorCodes.authorityMismatch]:
|
|
53
|
+
"Authority mismatch error. Authority provided in login request or PublicClientApplication config does not match the environment of the provided account. Please use a matching account or make an interactive request to login to this authority.",
|
|
54
|
+
};
|
|
7
55
|
|
|
8
56
|
/**
|
|
9
57
|
* ClientConfigurationErrorMessage class containing string constants used by error codes and messages.
|
|
58
|
+
* @deprecated Use ClientConfigurationErrorCodes instead
|
|
10
59
|
*/
|
|
11
60
|
export const ClientConfigurationErrorMessage = {
|
|
12
61
|
redirectUriNotSet: {
|
|
13
|
-
code:
|
|
14
|
-
desc:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
code: "post_logout_uri_empty",
|
|
18
|
-
desc: "A post logout redirect has not been set.",
|
|
62
|
+
code: ClientConfigurationErrorCodes.redirectUriEmpty,
|
|
63
|
+
desc: ClientConfigurationErrorMessages[
|
|
64
|
+
ClientConfigurationErrorCodes.redirectUriEmpty
|
|
65
|
+
],
|
|
19
66
|
},
|
|
20
67
|
claimsRequestParsingError: {
|
|
21
|
-
code:
|
|
22
|
-
desc:
|
|
68
|
+
code: ClientConfigurationErrorCodes.claimsRequestParsingError,
|
|
69
|
+
desc: ClientConfigurationErrorMessages[
|
|
70
|
+
ClientConfigurationErrorCodes.claimsRequestParsingError
|
|
71
|
+
],
|
|
23
72
|
},
|
|
24
73
|
authorityUriInsecure: {
|
|
25
|
-
code:
|
|
26
|
-
desc:
|
|
74
|
+
code: ClientConfigurationErrorCodes.authorityUriInsecure,
|
|
75
|
+
desc: ClientConfigurationErrorMessages[
|
|
76
|
+
ClientConfigurationErrorCodes.authorityUriInsecure
|
|
77
|
+
],
|
|
27
78
|
},
|
|
28
79
|
urlParseError: {
|
|
29
|
-
code:
|
|
30
|
-
desc:
|
|
80
|
+
code: ClientConfigurationErrorCodes.urlParseError,
|
|
81
|
+
desc: ClientConfigurationErrorMessages[
|
|
82
|
+
ClientConfigurationErrorCodes.urlParseError
|
|
83
|
+
],
|
|
31
84
|
},
|
|
32
85
|
urlEmptyError: {
|
|
33
|
-
code:
|
|
34
|
-
desc:
|
|
86
|
+
code: ClientConfigurationErrorCodes.urlEmptyError,
|
|
87
|
+
desc: ClientConfigurationErrorMessages[
|
|
88
|
+
ClientConfigurationErrorCodes.urlEmptyError
|
|
89
|
+
],
|
|
35
90
|
},
|
|
36
91
|
emptyScopesError: {
|
|
37
|
-
code:
|
|
38
|
-
desc:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
code: "nonarray_input_scopes_error",
|
|
42
|
-
desc: "Scopes cannot be passed as non-array.",
|
|
43
|
-
},
|
|
44
|
-
clientIdSingleScopeError: {
|
|
45
|
-
code: "clientid_input_scopes_error",
|
|
46
|
-
desc: "Client ID can only be provided as a single scope.",
|
|
92
|
+
code: ClientConfigurationErrorCodes.emptyInputScopesError,
|
|
93
|
+
desc: ClientConfigurationErrorMessages[
|
|
94
|
+
ClientConfigurationErrorCodes.emptyInputScopesError
|
|
95
|
+
],
|
|
47
96
|
},
|
|
48
97
|
invalidPrompt: {
|
|
49
|
-
code:
|
|
50
|
-
desc:
|
|
98
|
+
code: ClientConfigurationErrorCodes.invalidPromptValue,
|
|
99
|
+
desc: ClientConfigurationErrorMessages[
|
|
100
|
+
ClientConfigurationErrorCodes.invalidPromptValue
|
|
101
|
+
],
|
|
51
102
|
},
|
|
52
103
|
invalidClaimsRequest: {
|
|
53
|
-
code:
|
|
54
|
-
desc:
|
|
104
|
+
code: ClientConfigurationErrorCodes.invalidClaims,
|
|
105
|
+
desc: ClientConfigurationErrorMessages[
|
|
106
|
+
ClientConfigurationErrorCodes.invalidClaims
|
|
107
|
+
],
|
|
55
108
|
},
|
|
56
109
|
tokenRequestEmptyError: {
|
|
57
|
-
code:
|
|
58
|
-
desc:
|
|
110
|
+
code: ClientConfigurationErrorCodes.tokenRequestEmpty,
|
|
111
|
+
desc: ClientConfigurationErrorMessages[
|
|
112
|
+
ClientConfigurationErrorCodes.tokenRequestEmpty
|
|
113
|
+
],
|
|
59
114
|
},
|
|
60
115
|
logoutRequestEmptyError: {
|
|
61
|
-
code:
|
|
62
|
-
desc:
|
|
116
|
+
code: ClientConfigurationErrorCodes.logoutRequestEmpty,
|
|
117
|
+
desc: ClientConfigurationErrorMessages[
|
|
118
|
+
ClientConfigurationErrorCodes.logoutRequestEmpty
|
|
119
|
+
],
|
|
63
120
|
},
|
|
64
121
|
invalidCodeChallengeMethod: {
|
|
65
|
-
code:
|
|
66
|
-
desc:
|
|
122
|
+
code: ClientConfigurationErrorCodes.invalidCodeChallengeMethod,
|
|
123
|
+
desc: ClientConfigurationErrorMessages[
|
|
124
|
+
ClientConfigurationErrorCodes.invalidCodeChallengeMethod
|
|
125
|
+
],
|
|
67
126
|
},
|
|
68
127
|
invalidCodeChallengeParams: {
|
|
69
|
-
code:
|
|
70
|
-
desc:
|
|
128
|
+
code: ClientConfigurationErrorCodes.pkceParamsMissing,
|
|
129
|
+
desc: ClientConfigurationErrorMessages[
|
|
130
|
+
ClientConfigurationErrorCodes.pkceParamsMissing
|
|
131
|
+
],
|
|
71
132
|
},
|
|
72
133
|
invalidCloudDiscoveryMetadata: {
|
|
73
|
-
code:
|
|
74
|
-
desc:
|
|
134
|
+
code: ClientConfigurationErrorCodes.invalidCloudDiscoveryMetadata,
|
|
135
|
+
desc: ClientConfigurationErrorMessages[
|
|
136
|
+
ClientConfigurationErrorCodes.invalidCloudDiscoveryMetadata
|
|
137
|
+
],
|
|
75
138
|
},
|
|
76
139
|
invalidAuthorityMetadata: {
|
|
77
|
-
code:
|
|
78
|
-
desc:
|
|
140
|
+
code: ClientConfigurationErrorCodes.invalidAuthorityMetadata,
|
|
141
|
+
desc: ClientConfigurationErrorMessages[
|
|
142
|
+
ClientConfigurationErrorCodes.invalidAuthorityMetadata
|
|
143
|
+
],
|
|
79
144
|
},
|
|
80
145
|
untrustedAuthority: {
|
|
81
|
-
code:
|
|
82
|
-
desc:
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
code: "invalid_azure_cloud_instance",
|
|
86
|
-
desc: "Invalid AzureCloudInstance provided. Please refer MSAL JS docs: aks.ms/msaljs/azure_cloud_instance for valid values",
|
|
146
|
+
code: ClientConfigurationErrorCodes.untrustedAuthority,
|
|
147
|
+
desc: ClientConfigurationErrorMessages[
|
|
148
|
+
ClientConfigurationErrorCodes.untrustedAuthority
|
|
149
|
+
],
|
|
87
150
|
},
|
|
88
151
|
missingSshJwk: {
|
|
89
|
-
code:
|
|
90
|
-
desc:
|
|
152
|
+
code: ClientConfigurationErrorCodes.missingSshJwk,
|
|
153
|
+
desc: ClientConfigurationErrorMessages[
|
|
154
|
+
ClientConfigurationErrorCodes.missingSshJwk
|
|
155
|
+
],
|
|
91
156
|
},
|
|
92
157
|
missingSshKid: {
|
|
93
|
-
code:
|
|
94
|
-
desc:
|
|
158
|
+
code: ClientConfigurationErrorCodes.missingSshKid,
|
|
159
|
+
desc: ClientConfigurationErrorMessages[
|
|
160
|
+
ClientConfigurationErrorCodes.missingSshKid
|
|
161
|
+
],
|
|
95
162
|
},
|
|
96
163
|
missingNonceAuthenticationHeader: {
|
|
97
|
-
code:
|
|
98
|
-
desc:
|
|
164
|
+
code: ClientConfigurationErrorCodes.missingNonceAuthenticationHeader,
|
|
165
|
+
desc: ClientConfigurationErrorMessages[
|
|
166
|
+
ClientConfigurationErrorCodes.missingNonceAuthenticationHeader
|
|
167
|
+
],
|
|
99
168
|
},
|
|
100
169
|
invalidAuthenticationHeader: {
|
|
101
|
-
code:
|
|
102
|
-
desc:
|
|
170
|
+
code: ClientConfigurationErrorCodes.invalidAuthenticationHeader,
|
|
171
|
+
desc: ClientConfigurationErrorMessages[
|
|
172
|
+
ClientConfigurationErrorCodes.invalidAuthenticationHeader
|
|
173
|
+
],
|
|
103
174
|
},
|
|
104
175
|
cannotSetOIDCOptions: {
|
|
105
|
-
code:
|
|
106
|
-
desc:
|
|
176
|
+
code: ClientConfigurationErrorCodes.cannotSetOIDCOptions,
|
|
177
|
+
desc: ClientConfigurationErrorMessages[
|
|
178
|
+
ClientConfigurationErrorCodes.cannotSetOIDCOptions
|
|
179
|
+
],
|
|
107
180
|
},
|
|
108
181
|
cannotAllowNativeBroker: {
|
|
109
|
-
code:
|
|
110
|
-
desc:
|
|
182
|
+
code: ClientConfigurationErrorCodes.cannotAllowNativeBroker,
|
|
183
|
+
desc: ClientConfigurationErrorMessages[
|
|
184
|
+
ClientConfigurationErrorCodes.cannotAllowNativeBroker
|
|
185
|
+
],
|
|
111
186
|
},
|
|
112
187
|
authorityMismatch: {
|
|
113
|
-
code:
|
|
114
|
-
desc:
|
|
188
|
+
code: ClientConfigurationErrorCodes.authorityMismatch,
|
|
189
|
+
desc: ClientConfigurationErrorMessages[
|
|
190
|
+
ClientConfigurationErrorCodes.authorityMismatch
|
|
191
|
+
],
|
|
115
192
|
},
|
|
116
193
|
};
|
|
117
194
|
|
|
118
195
|
/**
|
|
119
196
|
* Error thrown when there is an error in configuration of the MSAL.js library.
|
|
120
197
|
*/
|
|
121
|
-
export class ClientConfigurationError extends
|
|
122
|
-
constructor(errorCode: string
|
|
123
|
-
super(errorCode,
|
|
198
|
+
export class ClientConfigurationError extends AuthError {
|
|
199
|
+
constructor(errorCode: string) {
|
|
200
|
+
super(errorCode, ClientConfigurationErrorMessages[errorCode]);
|
|
124
201
|
this.name = "ClientConfigurationError";
|
|
125
202
|
Object.setPrototypeOf(this, ClientConfigurationError.prototype);
|
|
126
203
|
}
|
|
204
|
+
}
|
|
127
205
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
return new ClientConfigurationError(
|
|
133
|
-
ClientConfigurationErrorMessage.redirectUriNotSet.code,
|
|
134
|
-
ClientConfigurationErrorMessage.redirectUriNotSet.desc
|
|
135
|
-
);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* Creates an error thrown when the post-logout redirect uri is empty (not set by caller)
|
|
140
|
-
*/
|
|
141
|
-
static createPostLogoutRedirectUriEmptyError(): ClientConfigurationError {
|
|
142
|
-
return new ClientConfigurationError(
|
|
143
|
-
ClientConfigurationErrorMessage.postLogoutUriNotSet.code,
|
|
144
|
-
ClientConfigurationErrorMessage.postLogoutUriNotSet.desc
|
|
145
|
-
);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* Creates an error thrown when the claims request could not be successfully parsed
|
|
150
|
-
*/
|
|
151
|
-
static createClaimsRequestParsingError(
|
|
152
|
-
claimsRequestParseError: string
|
|
153
|
-
): ClientConfigurationError {
|
|
154
|
-
return new ClientConfigurationError(
|
|
155
|
-
ClientConfigurationErrorMessage.claimsRequestParsingError.code,
|
|
156
|
-
`${ClientConfigurationErrorMessage.claimsRequestParsingError.desc} Given value: ${claimsRequestParseError}`
|
|
157
|
-
);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* Creates an error thrown if authority uri is given an insecure protocol.
|
|
162
|
-
* @param urlString
|
|
163
|
-
*/
|
|
164
|
-
static createInsecureAuthorityUriError(
|
|
165
|
-
urlString: string
|
|
166
|
-
): ClientConfigurationError {
|
|
167
|
-
return new ClientConfigurationError(
|
|
168
|
-
ClientConfigurationErrorMessage.authorityUriInsecure.code,
|
|
169
|
-
`${ClientConfigurationErrorMessage.authorityUriInsecure.desc} Given URI: ${urlString}`
|
|
170
|
-
);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* Creates an error thrown if URL string does not parse into separate segments.
|
|
175
|
-
* @param urlString
|
|
176
|
-
*/
|
|
177
|
-
static createUrlParseError(
|
|
178
|
-
urlParseError: string
|
|
179
|
-
): ClientConfigurationError {
|
|
180
|
-
return new ClientConfigurationError(
|
|
181
|
-
ClientConfigurationErrorMessage.urlParseError.code,
|
|
182
|
-
`${ClientConfigurationErrorMessage.urlParseError.desc} Given Error: ${urlParseError}`
|
|
183
|
-
);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
/**
|
|
187
|
-
* Creates an error thrown if URL string is empty or null.
|
|
188
|
-
* @param urlString
|
|
189
|
-
*/
|
|
190
|
-
static createUrlEmptyError(): ClientConfigurationError {
|
|
191
|
-
return new ClientConfigurationError(
|
|
192
|
-
ClientConfigurationErrorMessage.urlEmptyError.code,
|
|
193
|
-
ClientConfigurationErrorMessage.urlEmptyError.desc
|
|
194
|
-
);
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* Error thrown when scopes are empty.
|
|
199
|
-
* @param scopesValue
|
|
200
|
-
*/
|
|
201
|
-
static createEmptyScopesArrayError(): ClientConfigurationError {
|
|
202
|
-
return new ClientConfigurationError(
|
|
203
|
-
ClientConfigurationErrorMessage.emptyScopesError.code,
|
|
204
|
-
`${ClientConfigurationErrorMessage.emptyScopesError.desc}`
|
|
205
|
-
);
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
/**
|
|
209
|
-
* Error thrown when client id scope is not provided as single scope.
|
|
210
|
-
* @param inputScopes
|
|
211
|
-
*/
|
|
212
|
-
static createClientIdSingleScopeError(
|
|
213
|
-
inputScopes: Array<string>
|
|
214
|
-
): ClientConfigurationError {
|
|
215
|
-
return new ClientConfigurationError(
|
|
216
|
-
ClientConfigurationErrorMessage.clientIdSingleScopeError.code,
|
|
217
|
-
`${ClientConfigurationErrorMessage.clientIdSingleScopeError.desc} Given Scopes: ${inputScopes}`
|
|
218
|
-
);
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
/**
|
|
222
|
-
* Error thrown when prompt is not an allowed type.
|
|
223
|
-
* @param promptValue
|
|
224
|
-
*/
|
|
225
|
-
static createInvalidPromptError(
|
|
226
|
-
promptValue: string
|
|
227
|
-
): ClientConfigurationError {
|
|
228
|
-
return new ClientConfigurationError(
|
|
229
|
-
ClientConfigurationErrorMessage.invalidPrompt.code,
|
|
230
|
-
`${ClientConfigurationErrorMessage.invalidPrompt.desc} Given value: ${promptValue}`
|
|
231
|
-
);
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
/**
|
|
235
|
-
* Creates error thrown when claims parameter is not a stringified JSON object
|
|
236
|
-
*/
|
|
237
|
-
static createInvalidClaimsRequestError(): ClientConfigurationError {
|
|
238
|
-
return new ClientConfigurationError(
|
|
239
|
-
ClientConfigurationErrorMessage.invalidClaimsRequest.code,
|
|
240
|
-
ClientConfigurationErrorMessage.invalidClaimsRequest.desc
|
|
241
|
-
);
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
/**
|
|
245
|
-
* Throws error when token request is empty and nothing cached in storage.
|
|
246
|
-
*/
|
|
247
|
-
static createEmptyLogoutRequestError(): ClientConfigurationError {
|
|
248
|
-
return new ClientConfigurationError(
|
|
249
|
-
ClientConfigurationErrorMessage.logoutRequestEmptyError.code,
|
|
250
|
-
ClientConfigurationErrorMessage.logoutRequestEmptyError.desc
|
|
251
|
-
);
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
/**
|
|
255
|
-
* Throws error when token request is empty and nothing cached in storage.
|
|
256
|
-
*/
|
|
257
|
-
static createEmptyTokenRequestError(): ClientConfigurationError {
|
|
258
|
-
return new ClientConfigurationError(
|
|
259
|
-
ClientConfigurationErrorMessage.tokenRequestEmptyError.code,
|
|
260
|
-
ClientConfigurationErrorMessage.tokenRequestEmptyError.desc
|
|
261
|
-
);
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
/**
|
|
265
|
-
* Throws error when an invalid code_challenge_method is passed by the user
|
|
266
|
-
*/
|
|
267
|
-
static createInvalidCodeChallengeMethodError(): ClientConfigurationError {
|
|
268
|
-
return new ClientConfigurationError(
|
|
269
|
-
ClientConfigurationErrorMessage.invalidCodeChallengeMethod.code,
|
|
270
|
-
ClientConfigurationErrorMessage.invalidCodeChallengeMethod.desc
|
|
271
|
-
);
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
/**
|
|
275
|
-
* Throws error when both params: code_challenge and code_challenge_method are not passed together
|
|
276
|
-
*/
|
|
277
|
-
static createInvalidCodeChallengeParamsError(): ClientConfigurationError {
|
|
278
|
-
return new ClientConfigurationError(
|
|
279
|
-
ClientConfigurationErrorMessage.invalidCodeChallengeParams.code,
|
|
280
|
-
ClientConfigurationErrorMessage.invalidCodeChallengeParams.desc
|
|
281
|
-
);
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
/**
|
|
285
|
-
* Throws an error when the user passes invalid cloudDiscoveryMetadata
|
|
286
|
-
*/
|
|
287
|
-
static createInvalidCloudDiscoveryMetadataError(): ClientConfigurationError {
|
|
288
|
-
return new ClientConfigurationError(
|
|
289
|
-
ClientConfigurationErrorMessage.invalidCloudDiscoveryMetadata.code,
|
|
290
|
-
ClientConfigurationErrorMessage.invalidCloudDiscoveryMetadata.desc
|
|
291
|
-
);
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
/**
|
|
295
|
-
* Throws an error when the user passes invalid cloudDiscoveryMetadata
|
|
296
|
-
*/
|
|
297
|
-
static createInvalidAuthorityMetadataError(): ClientConfigurationError {
|
|
298
|
-
return new ClientConfigurationError(
|
|
299
|
-
ClientConfigurationErrorMessage.invalidAuthorityMetadata.code,
|
|
300
|
-
ClientConfigurationErrorMessage.invalidAuthorityMetadata.desc
|
|
301
|
-
);
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
/**
|
|
305
|
-
* Throws error when provided authority is not a member of the trusted host list
|
|
306
|
-
*/
|
|
307
|
-
static createUntrustedAuthorityError(): ClientConfigurationError {
|
|
308
|
-
return new ClientConfigurationError(
|
|
309
|
-
ClientConfigurationErrorMessage.untrustedAuthority.code,
|
|
310
|
-
ClientConfigurationErrorMessage.untrustedAuthority.desc
|
|
311
|
-
);
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
/**
|
|
315
|
-
* Throws error when the AzureCloudInstance is set to an invalid value
|
|
316
|
-
*/
|
|
317
|
-
static createInvalidAzureCloudInstanceError(): ClientConfigurationError {
|
|
318
|
-
return new ClientConfigurationError(
|
|
319
|
-
ClientConfigurationErrorMessage.invalidAzureCloudInstance.code,
|
|
320
|
-
ClientConfigurationErrorMessage.invalidAzureCloudInstance.desc
|
|
321
|
-
);
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
/**
|
|
325
|
-
* Throws an error when the authentication scheme is set to SSH but the SSH public key is omitted from the request
|
|
326
|
-
*/
|
|
327
|
-
static createMissingSshJwkError(): ClientConfigurationError {
|
|
328
|
-
return new ClientConfigurationError(
|
|
329
|
-
ClientConfigurationErrorMessage.missingSshJwk.code,
|
|
330
|
-
ClientConfigurationErrorMessage.missingSshJwk.desc
|
|
331
|
-
);
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
/**
|
|
335
|
-
* Throws an error when the authentication scheme is set to SSH but the SSH public key ID is omitted from the request
|
|
336
|
-
*/
|
|
337
|
-
static createMissingSshKidError(): ClientConfigurationError {
|
|
338
|
-
return new ClientConfigurationError(
|
|
339
|
-
ClientConfigurationErrorMessage.missingSshKid.code,
|
|
340
|
-
ClientConfigurationErrorMessage.missingSshKid.desc
|
|
341
|
-
);
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
/**
|
|
345
|
-
* Throws error when provided headers don't contain a header that a server nonce can be extracted from
|
|
346
|
-
*/
|
|
347
|
-
static createMissingNonceAuthenticationHeadersError(): ClientConfigurationError {
|
|
348
|
-
return new ClientConfigurationError(
|
|
349
|
-
ClientConfigurationErrorMessage.missingNonceAuthenticationHeader.code,
|
|
350
|
-
ClientConfigurationErrorMessage.missingNonceAuthenticationHeader.desc
|
|
351
|
-
);
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
/**
|
|
355
|
-
* Throws error when a provided header is invalid in any way
|
|
356
|
-
*/
|
|
357
|
-
static createInvalidAuthenticationHeaderError(
|
|
358
|
-
invalidHeaderName: string,
|
|
359
|
-
details: string
|
|
360
|
-
): ClientConfigurationError {
|
|
361
|
-
return new ClientConfigurationError(
|
|
362
|
-
ClientConfigurationErrorMessage.invalidAuthenticationHeader.code,
|
|
363
|
-
`${ClientConfigurationErrorMessage.invalidAuthenticationHeader.desc}. Invalid header: ${invalidHeaderName}. Details: ${details}`
|
|
364
|
-
);
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
/**
|
|
368
|
-
* Throws error when provided non-default OIDCOptions when not in OIDC protocol mode
|
|
369
|
-
*/
|
|
370
|
-
static createCannotSetOIDCOptionsError(): ClientConfigurationError {
|
|
371
|
-
return new ClientConfigurationError(
|
|
372
|
-
ClientConfigurationErrorMessage.cannotSetOIDCOptions.code,
|
|
373
|
-
ClientConfigurationErrorMessage.cannotSetOIDCOptions.desc
|
|
374
|
-
);
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
/**
|
|
378
|
-
* Throws error when allowNativeBroker is set to true when not in AAD protocol mode
|
|
379
|
-
*/
|
|
380
|
-
static createCannotAllowNativeBrokerError(): ClientConfigurationError {
|
|
381
|
-
return new ClientConfigurationError(
|
|
382
|
-
ClientConfigurationErrorMessage.cannotAllowNativeBroker.code,
|
|
383
|
-
ClientConfigurationErrorMessage.cannotAllowNativeBroker.desc
|
|
384
|
-
);
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
/**
|
|
388
|
-
* Create an error when the authority provided in request does not match authority provided in account or MSAL.js configuration.
|
|
389
|
-
*/
|
|
390
|
-
static createAuthorityMismatchError(): ClientConfigurationError {
|
|
391
|
-
return new ClientConfigurationError(
|
|
392
|
-
ClientConfigurationErrorMessage.authorityMismatch.code,
|
|
393
|
-
ClientConfigurationErrorMessage.authorityMismatch.desc
|
|
394
|
-
);
|
|
395
|
-
}
|
|
206
|
+
export function createClientConfigurationError(
|
|
207
|
+
errorCode: string
|
|
208
|
+
): ClientConfigurationError {
|
|
209
|
+
return new ClientConfigurationError(errorCode);
|
|
396
210
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export const redirectUriEmpty = "redirect_uri_empty";
|
|
7
|
+
export const claimsRequestParsingError = "claims_request_parsing_error";
|
|
8
|
+
export const authorityUriInsecure = "authority_uri_insecure";
|
|
9
|
+
export const urlParseError = "url_parse_error";
|
|
10
|
+
export const urlEmptyError = "empty_url_error";
|
|
11
|
+
export const emptyInputScopesError = "empty_input_scopes_error";
|
|
12
|
+
export const invalidPromptValue = "invalid_prompt_value";
|
|
13
|
+
export const invalidClaims = "invalid_claims";
|
|
14
|
+
export const tokenRequestEmpty = "token_request_empty";
|
|
15
|
+
export const logoutRequestEmpty = "logout_request_empty";
|
|
16
|
+
export const invalidCodeChallengeMethod = "invalid_code_challenge_method";
|
|
17
|
+
export const pkceParamsMissing = "pkce_params_missing";
|
|
18
|
+
export const invalidCloudDiscoveryMetadata = "invalid_cloud_discovery_metadata";
|
|
19
|
+
export const invalidAuthorityMetadata = "invalid_authority_metadata";
|
|
20
|
+
export const untrustedAuthority = "untrusted_authority";
|
|
21
|
+
export const missingSshJwk = "missing_ssh_jwk";
|
|
22
|
+
export const missingSshKid = "missing_ssh_kid";
|
|
23
|
+
export const missingNonceAuthenticationHeader =
|
|
24
|
+
"missing_nonce_authentication_header";
|
|
25
|
+
export const invalidAuthenticationHeader = "invalid_authentication_header";
|
|
26
|
+
export const cannotSetOIDCOptions = "cannot_set_OIDCOptions";
|
|
27
|
+
export const cannotAllowNativeBroker = "cannot_allow_native_broker";
|
|
28
|
+
export const authorityMismatch = "authority_mismatch";
|