I add all user roles to the role claim of JWT and when added more roles I get this error http://localhost:4200 has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource and when removing some of the roles everything working fine
Asked
Active
Viewed 2,116 times
1 Answers
0
By default, a user's claims are stored in the authentication cookie. If the authentication cookie is too large, it can cause the app to fail because:
- The browser detects that the cookie header is too long.
- The overall size of the request is too large.
If a large amount of user data is required for processing user requests:
- Limit the number and size of user claims for request processing to only what the app requires.
- Use a custom ITicketStore for the Cookie Authentication Middleware's SessionStore to store identity across requests. Preserve large quantities of identity information on the server while only sending a small session identifier key to the client.
And maybe this answer would help you Link

Matt Qafouri
- 1,449
- 2
- 12
- 26