aspnet identity invalid token on confirmation email

后端 未结 5 1402
小蘑菇
小蘑菇 2020-12-01 14:38

I\'m trying to confirm an account but I\'m getting \"invalid token.\" error.

Here\'s what I\'m trying:

var code = await UserManager.GenerateEmailConf         


        
5条回答
  •  半阙折子戏
    2020-12-01 15:20

    Serdar's solution was the key to the solution for empty spaces and + simbols using Angular as client web application.

    But sometimes I was getting random "invalid token" error messages. AFter some queries to the user's database I've found that those errors were only with those users having spaces o dashes in their UserName.

    Solution was configure the User Manager to allow those characters in UserNames. Meant to say that my user database was migrated from Druppal directly to SQL Server and many of those users avoided the default policy from UserValidator at User Manager.

    You can find how-to configure the UserValidator to allow non-alphanumeric characters at the end of this thread:

    Asp.NET - Identity 2 - Invalid Token Error

提交回复
热议问题