|
1 | 1 | # MSAL.js errors |
2 | 2 |
|
| 3 | +## Common errors |
| 4 | + |
| 5 | +### `unexpected_error` |
| 6 | +- Unexpected error in authentication. |
| 7 | + |
| 8 | +### `post_request_failed` |
| 9 | +- Post request failed from the network, could be a 4xx/5xx or a network unavailability. Please check the exact error code for details. |
| 10 | + |
| 11 | +### `cache_quota_exceeded` |
| 12 | +- Exceeded cache storage capacity. |
| 13 | + |
| 14 | +This error occurs when MSAL.js surpasses the allotted storage limit when attempting to save token information in the [configured cache storage](./caching.md#cache-storage). See [here](https://developer.mozilla.org/en-US/docs/Web/API/Storage_API/Storage_quotas_and_eviction_criteria#web_storage) for web storage limits. |
| 15 | + |
| 16 | +**Mitigation**: |
| 17 | + |
| 18 | +1. Make sure the configured cache storage has enough capacity to allow MSAL.js to persist token payload. The amount of cache storage required depends on the number of [cached artifacts](./caching.md#cached-artifacts). |
| 19 | +2. Disable [claimsBasedCachingEnabled](./configuration.md#cache-config-options) cache config option. When enabled, it caches access tokens under a key containing the hash of the requested claims. Depending on the MSAL.js API usage, it may result in the vast number of access tokens persisted in the cache storage. |
| 20 | + |
| 21 | +### `cache_error_unknown` |
| 22 | +- An unknown error occurred while accessing the browser cache. |
| 23 | + |
| 24 | +### `client_info_decoding_error` |
| 25 | +- The client info could not be parsed/decoded correctly. |
| 26 | + |
| 27 | +### `client_info_empty_error` |
| 28 | +- The client info was empty. |
| 29 | + |
| 30 | +### `token_parsing_error` |
| 31 | +- Token cannot be parsed. |
| 32 | + |
| 33 | +### `null_or_empty_token` |
| 34 | +- The token is null or empty. |
| 35 | + |
| 36 | +### `endpoints_resolution_error` |
| 37 | +- Could not resolve endpoints. Please check network and try again. |
| 38 | + |
| 39 | +### `network_error` |
| 40 | +- Network request failed. Please check network and try again. |
| 41 | + |
| 42 | +### `openid_config_error` |
| 43 | +- Could not retrieve endpoints. Check your authority and verify the .well-known/openid-configuration endpoint returns the required endpoints. |
| 44 | + |
| 45 | +### `hash_not_deserialized` |
| 46 | +- The hash parameters could not be deserialized. |
| 47 | + |
| 48 | +### `invalid_state` |
| 49 | +- State was not the expected format. |
| 50 | + |
| 51 | +### `state_mismatch` |
| 52 | +- State mismatch error. |
| 53 | + |
| 54 | +### `state_not_found` |
| 55 | +- State not found. |
| 56 | + |
| 57 | +### `nonce_mismatch` |
| 58 | +- Nonce mismatch error. |
| 59 | + |
| 60 | +### `auth_time_not_found` |
| 61 | +- Max Age was requested and the ID token is missing the auth_time variable auth_time is an optional claim and is not enabled by default - it must be enabled. See https://aka.ms/msaljs/optional-claims for more information. |
| 62 | + |
| 63 | +### `max_age_transpired` |
| 64 | +- Max Age is set to 0, or too much time has elapsed since the last end-user authentication. |
| 65 | + |
| 66 | +### `multiple_matching_tokens` |
| 67 | +- The cache contains multiple tokens satisfying the requirements. Call AcquireToken again providing more requirements such as authority or account. |
| 68 | + |
| 69 | +### `multiple_matching_appMetadata` |
| 70 | +- The cache contains multiple appMetadata satisfying the given parameters. Please pass more info to obtain the correct appMetadata. |
| 71 | + |
| 72 | +### `request_cannot_be_made` |
| 73 | +- Token request cannot be made without authorization code or refresh token. |
| 74 | + |
| 75 | +### `cannot_remove_empty_scope` |
| 76 | +- Cannot remove null or empty scope from ScopeSet. |
| 77 | + |
| 78 | +### `cannot_append_scopeset` |
| 79 | +- Cannot append ScopeSet. |
| 80 | + |
| 81 | +### `empty_input_scopeset` |
| 82 | +- Empty input ScopeSet cannot be processed. |
| 83 | + |
| 84 | +### `no_account_in_silent_request` |
| 85 | +- Please pass an account object, silent flow is not supported without account information. |
| 86 | + |
| 87 | +### `invalid_cache_record` |
| 88 | +- Cache record object was null or undefined. |
| 89 | + |
| 90 | +### `invalid_cache_environment` |
| 91 | +- Invalid environment when attempting to create cache entry. |
| 92 | + |
| 93 | +### `no_account_found` |
| 94 | +- No account found in cache for given key. |
| 95 | + |
| 96 | +### `no_crypto_object` |
| 97 | +- No crypto object detected. |
| 98 | + |
| 99 | +### `unexpected_credential_type` |
| 100 | +- Unexpected credential type. |
| 101 | + |
| 102 | +### `token_refresh_required` |
| 103 | +- 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. |
| 104 | + |
| 105 | +### `token_claims_cnf_required_for_signedjwt` |
| 106 | +- Cannot generate a POP jwt if the token_claims are not populated. |
| 107 | + |
| 108 | +### `authorization_code_missing_from_server_response` |
| 109 | +- Server response does not contain an authorization code to proceed. |
| 110 | + |
| 111 | +### `binding_key_not_removed` |
| 112 | +- Could not remove the credential's binding key from storage. |
| 113 | + |
| 114 | +### `end_session_endpoint_not_supported` |
| 115 | +- The provided authority does not support logout. |
| 116 | + |
| 117 | +### `key_id_missing` |
| 118 | +- 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. |
| 119 | + |
| 120 | +### `no_network_connectivity` |
| 121 | +- No network connectivity. Check your internet connection. |
| 122 | + |
| 123 | +### `user_canceled` |
| 124 | +- User cancelled the flow. |
| 125 | + |
| 126 | +### `method_not_implemented` |
| 127 | +- This method has not been implemented. |
| 128 | + |
| 129 | +### `nested_app_auth_bridge_disabled` |
| 130 | +- The nested app auth bridge is disabled. |
| 131 | + |
| 132 | +### `redirect_uri_empty` |
| 133 | +- A redirect URI is required for all calls, and none has been set. |
| 134 | + |
| 135 | +### `claims_request_parsing_error` |
| 136 | +- Could not parse the given claims request object. |
| 137 | + |
| 138 | +### `authority_uri_insecure` |
| 139 | +- 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. |
| 140 | + |
| 141 | +### `url_parse_error` |
| 142 | +- URL could not be parsed into appropriate segments. |
| 143 | + |
| 144 | +### `empty_url_error` |
| 145 | +- URL was empty or null. |
| 146 | + |
| 147 | +### `empty_input_scopes_error` |
| 148 | +- Scopes cannot be passed as null, undefined or empty array because they are required to obtain an access token. |
| 149 | + |
| 150 | +### `invalid_prompt_value` |
| 151 | +- Invalid prompt value. Please see here for valid configuration options: https://azuread.github.io/microsoft-authentication-library-for-js/ref/modules/_azure_msal_common.html#commonauthorizationurlrequest |
| 152 | + |
| 153 | +### `invalid_claims` |
| 154 | +- Given claims parameter must be a stringified JSON object. |
| 155 | + |
| 156 | +### `token_request_empty` |
| 157 | +- Token request was empty and not found in cache. |
| 158 | + |
| 159 | +### `logout_request_empty` |
| 160 | +- The logout request was null or undefined. |
| 161 | + |
| 162 | +### `invalid_code_challenge_method` |
| 163 | +- code_challenge_method passed is invalid. Valid values are "plain" and "S256". |
| 164 | + |
| 165 | +### `pkce_params_missing` |
| 166 | +- Both params: code_challenge and code_challenge_method are to be passed if to be sent in the request. |
| 167 | + |
| 168 | +### `invalid_cloud_discovery_metadata` |
| 169 | +- Invalid cloudDiscoveryMetadata provided. Must be a stringified JSON object containing tenant_discovery_endpoint and metadata fields. |
| 170 | + |
| 171 | +### `invalid_authority_metadata` |
| 172 | +- Invalid authorityMetadata provided. Must by a stringified JSON object containing authorization_endpoint, token_endpoint, issuer fields. |
| 173 | + |
| 174 | +### `untrusted_authority` |
| 175 | +- The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter. |
| 176 | + |
| 177 | +### `missing_ssh_jwk` |
| 178 | +- Missing sshJwk in SSH certificate request. A stringified JSON Web Key is required when using the SSH authentication scheme. |
| 179 | + |
| 180 | +### `missing_ssh_kid` |
| 181 | +- Missing sshKid in SSH certificate request. A string that uniquely identifies the public SSH key is required when using the SSH authentication scheme. |
| 182 | + |
| 183 | +### `missing_nonce_authentication_header` |
| 184 | +- 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. |
| 185 | + |
| 186 | +### `invalid_authentication_header` |
| 187 | +- Invalid authentication header provided. |
| 188 | + |
| 189 | +### `cannot_set_OIDCOptions` |
| 190 | +- Cannot set OIDCOptions parameter. Please change the protocol mode to OIDC or use a non-Microsoft authority. |
| 191 | + |
| 192 | +### `cannot_allow_platform_broker` |
| 193 | +- Cannot set allowPlatformBroker parameter to true when not in AAD protocol mode. |
| 194 | + |
| 195 | +### `authority_mismatch` |
| 196 | +- 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. |
| 197 | + |
| 198 | +### `no_tokens_found` |
| 199 | +- No refresh token found in the cache. Please sign-in. |
| 200 | + |
| 201 | +### `native_account_unavailable` |
| 202 | +- The requested account is not available in the native broker. It may have been deleted or logged out. Please sign-in again using an interactive API. |
| 203 | + |
| 204 | +### `refresh_token_expired` |
| 205 | +- Refresh token has expired. |
| 206 | + |
| 207 | +### `interaction_required` |
| 208 | +- User interaction is required. |
| 209 | + |
| 210 | +### `consent_required` |
| 211 | +- User consent is required. |
| 212 | + |
| 213 | +### `login_required` |
| 214 | +- User login is required. |
| 215 | + |
| 216 | +### `bad_token` |
| 217 | +- Identity provider returned bad_token due to an expired or invalid refresh token. Please invoke an interactive API to resolve. |
| 218 | + |
| 219 | +### `missing_kid_error` |
| 220 | +- The JOSE Header for the requested JWT, JWS or JWK object requires a keyId to be configured as the 'kid' header claim. No 'kid' value was provided. |
| 221 | + |
| 222 | +### `missing_alg_error` |
| 223 | +- The JOSE Header for the requested JWT, JWS or JWK object requires an algorithm to be specified as the 'alg' header claim. No 'alg' value was provided. |
| 224 | + |
| 225 | +## Browser errors |
| 226 | + |
3 | 227 | ### `pkce_not_created` |
4 | 228 | - The PKCE code challenge and verifier could not be generated. |
5 | 229 |
|
|
0 commit comments