431 Request Header Fields Too Large due to msal long cookie send in headers
See original GitHub issuePlease follow the issue template below. Failure to do so will result in a delay in answering your question.
Library
-
msal@1.2.1
Framework
React v16.6
Description
Due to loo long cookie send in request header azure webapp returning 431 error ie request headers field too large. After looking into the issues found that cookie send in the header is too long causing this issue.
cookie shown in request headers(in chrome network tab) contains a long info about msal as follows.
It contains msal login urls, client-info, nonce, authority and many other thing prefixed with msal.
I think cookie sent as header contain duplicate info about msal…
Configuration
const config = {
auth: {
clientId: process.env.REACT_APP_EnterpriseADAppClientID,
redirectUri: redirectUri,
postLogoutRedirectUri : redirectUri
},
cache: {
cacheLocation: "localStorage",
storeAuthStateInCookie: true
},
system: {
logger: logger,
tokenRenewalOffsetSeconds: 300
}
}
Browsers
Chrome
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How To Fix HTTP Error 431 Request Header Fields Too Large
Typically, the HTTP error 431 is caused by issues with cookies, long referrer URLs, or just the total size of the request headers....
Read more >431 Request Header Fields Too Large - HTTP - MDN Web Docs
The Referer URL is too long; There are too many Cookies sent in the request. Status. 431 Request Header Fields Too Large
Read more >msal.js - Error 431 Request Header Fields Too Large after ...
Due to loo long cookie send in request header azure webapp returning 431 error ie request headers field too large.
Read more >HTTP Error 431: 3 Ways to Fix Request Header Fields Too ...
The HTTP Error 431: Request Header Fields Too Large response status code indicates that the origin server refuses to fulfill users' requests.
Read more >431 Request Header Fields Too Large - Nuxt Auth With Azure ...
These cookies are meant only for MSAL, but they could get sent with an AJAX request sent to the server, and if these...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Even after updating to latest version getting same issue, Cookie size in the request header is still the same
Closing as duplicate, tracked in #1188