-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Move auth error messages out of the bundle #7744
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Move auth error messages out of the bundle
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
|
||
**[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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 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. |
@@ -66,7 +65,7 @@ import * as BrowserUtils from "../../src/utils/BrowserUtils.js"; | |||
import { FetchClient } from "../../src/network/FetchClient.js"; | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be combined with the import on line 59 above?
@@ -89,6 +88,7 @@ import { | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be combined with the import on line 69 above?
import { SsoSilentRequest } from "../../src/index.js"; | ||
import { getDefaultErrorMessage } from "../../src/error/BrowserAuthError.js"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same with import here
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Combine with line above?
createJoseHeaderError, | ||
} from "../../src/error/JoseHeaderError"; | ||
import { AuthError } from "../../src/error/AuthError"; | ||
import { getDefaultErrorMessage } from "../../src/error/AuthError.js"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Combine with above line