Move auth error messages out of the bundle#7744
Conversation
konstantin-msft
commented
May 12, 2025
- Move auth error messages out of the bundle
tnorling
left a comment
There was a problem hiding this comment.
I'd also like to see some sort of CI validation that a message actually exists in the doc for all error codes. I'm happy to treat that as its own separate work item, however, just calling it out as a requirement to call this work complete.
1e6185a to
1df8a91
Compare
Will address this in a follow-up PR |
jo-arroyo
left a comment
There was a problem hiding this comment.
Hi, I know this is merged already, but I noticed some potentially broken links that may need to be addressed in a separate PR, and there are some other suggestions that you can choose to take or not.
| - Exceeded cache storage capacity. | ||
|
|
||
| **[Other](#other)** | ||
| 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. |
There was a problem hiding this comment.
The link to the caching doc may need to be changed now that this doc has been moved out of msal-browser
|
|
||
| **Mitigation**: | ||
|
|
||
| 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). |
There was a problem hiding this comment.
Same here for caching doc
| **Mitigation**: | ||
|
|
||
| 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). | ||
| 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. |
There was a problem hiding this comment.
Same here for configuration doc
| - Nonce mismatch error. | ||
|
|
||
| ### `auth_time_not_found` | ||
| - 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. |
There was a problem hiding this comment.
| - 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. | |
| - 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. |
| - The provided authority does not support logout. | ||
|
|
||
| ### `key_id_missing` | ||
| - 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. |
There was a problem hiding this comment.
| - 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. | |
| - A keyId value is missing from the requested bound token's cache record and is required to match the token to its stored binding key. |
| import { TestTimeUtils } from "msal-test-utils"; | ||
| import { PopupRequest } from "../../src/request/PopupRequest.js"; | ||
| import { emptyNavigateUri } from "../../src/error/BrowserAuthErrorCodes.js"; | ||
| import { getDefaultErrorMessage } from "../../src/error/BrowserAuthError.js"; |
There was a problem hiding this comment.
Can this be combined with the import on line 59 above?
| TestTimeUtils, | ||
| } from "msal-test-utils"; | ||
| import { BrowserPerformanceClient } from "../../src/telemetry/BrowserPerformanceClient.js"; | ||
| import { getDefaultErrorMessage } from "../../src/error/BrowserAuthError.js"; |
There was a problem hiding this comment.
Can this be combined with the import on line 69 above?
| import { AuthenticationResult } from "../../src/response/AuthenticationResult.js"; | ||
| import { SilentRequest } from "../../src/request/SilentRequest.js"; | ||
| import { SsoSilentRequest } from "../../src/index.js"; | ||
| import { getDefaultErrorMessage } from "../../src/error/BrowserAuthError.js"; |
| createClientAuthError, | ||
| } from "../../src/error/ClientAuthError"; | ||
| import { AuthError } from "../../src/error/AuthError"; | ||
| import { getDefaultErrorMessage } from "../../src/error/AuthError.js"; |
There was a problem hiding this comment.
Combine with line above?
| createJoseHeaderError, | ||
| } from "../../src/error/JoseHeaderError"; | ||
| import { AuthError } from "../../src/error/AuthError"; | ||
| import { getDefaultErrorMessage } from "../../src/error/AuthError.js"; |