ASP.Net Core Identity login status lost after deploy

前端 未结 2 2156
旧巷少年郎
旧巷少年郎 2020-12-14 01:17

I am using ASP.Net Core and MS Identity, I try to understand why after each deployment the login users are logged out. I am running on a IIS 8.5

I have been trying t

2条回答
  •  鱼传尺愫
    2020-12-14 01:58

    Authentication use Data Protection Stack. If data protection isn't configured, the keys are held in memory and discarded when the app restarts.

    If the key ring is stored in memory when the app restarts:

    • All cookie-based authentication tokens are invalidated.
    • Users are required to sign in again on their next request.
    • Any data protected with the key ring can no longer be decrypted. This may include CSRF tokens and ASP.NET Core MVC tempdata cookies.

    You have to configure data protection, more information here https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?tabs=aspnetcore2x#data-protection

提交回复
热议问题