Asp.NET Identity 2 giving “Invalid Token” error

前端 未结 21 1920
情话喂你
情话喂你 2020-11-27 03:04

I\'m using Asp.Net-Identity-2 and I\'m trying to verify email verification code using the below method. But I am getting an \"Invalid Token\"

21条回答
  •  粉色の甜心
    2020-11-27 03:38

    Here I've the same problem but after a lot of time I found that in my case the invalid token error was raised by the fact that my custom Account class has the Id property re-declared and overridden.

    Like that:

     public class Account : IdentityUser
     {
        [ScaffoldColumn(false)]
        public override string Id { get; set; } 
        //Other properties ....
     }
    

    So to fix it I've just removed that property and generated again the database schema just to be sure.

    Removing this solves the problem.

提交回复
热议问题