Identity Core Primary Key as Int not able to use SignInManager

前端 未结 2 1591
说谎
说谎 2021-01-24 16:08

What I\'m trying to do is the following:

Setup login/logout using Identity Core, with the Primary Key as Int. I followed the following article in the ASP.NET Core Docume

相关标签:
2条回答
  • 2021-01-24 16:16

    3 years later I have stubmled upon this issue. Recreating database didn't help. I have changed as above the PK from string to int and UserManager have been creating records successfully but then the SignInManager have been failing to sign in the newly created user with the same error.

    Solution:

    I have found out that just assiging a role to the user upon creation solved the issue.

    await userManager.AddToRoleAsync(user, UserRoles.Basic.ToString());
    
    0 讨论(0)
  • 2021-01-24 16:31

    Dropped and recreated the database ... pretty obvious.

    //Solved.

    0 讨论(0)
提交回复
热议问题