Reducing Identity cookie size in .NET Core 2.0?

左心房为你撑大大i 提交于 2019-12-06 11:47:27

问题


so here's my situation:

I have a .NET Core 2.0 web app which using Identity and Google auth. Claims retrieved from Google login are email, first name, last name, and domain.

Here's where I run in to some trouble. I also use the Google Directory service to obtain the user's email groups. These groups are used as roles for authorization within the app which get stored as claims, thus making the Identity cookie larger.

When someone has a ton of Google Groups, the cookie actually ends up being too big and gives the user a 502.3 error on our websites. Is there any way to reduce the size of the cookie? I know the issue lies within the Google Groups getting stored as claims. Is there another way to store them using the Identity framework that doesn't effect the cookie?

来源:https://stackoverflow.com/questions/48504013/reducing-identity-cookie-size-in-net-core-2-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!