How to Use ASP.NET Identity with your own Custom Table

前端 未结 1 811
一个人的身影
一个人的身影 2021-01-15 15:05

I have a very simple table that has UserID as int Password as text and Roles as text(comma separated). Can i customize ASP.NET Identity structure to use it with my table?

相关标签:
1条回答
  • 2021-01-15 15:35

    Yes, you can make Identity work with your structure. You'll have to implement IPasswordValidator to take whatever hashing (I hope it is hashed) is used for your password. Also you'll have to implement IUserStore to point to your table. And IUserRoleStore also have to be implemented to take roles from your CSV list.

    Here is an overview of the architecture: http://www.asp.net/identity/overview/extensibility/overview-of-custom-storage-providers-for-aspnet-identity

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