Using Antiforgery in ASP.NET Core and got error - the antiforgery token could not be decrypted

后端 未结 3 1714
时光取名叫无心
时光取名叫无心 2021-02-02 16:41

My ASP.Net Core MVC application have added Antiforgery middleware like below:

startup.cs

services.AddMvc();
services.Ad         


        
3条回答
  •  礼貌的吻别
    2021-02-02 17:32

    I've had this because I started using the application on a localhost port and then was trying to use it in docker with the same port. By then I had cookies that specified the key generated by my machine, so It wouldn't work on docker.

    TL;DR clear your cookies if you ever used that domain/port from other machines.

提交回复
热议问题