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

淺唱寂寞╮ 提交于 2019-12-01 09:18:23

问题


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:


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



来源:https://stackoverflow.com/questions/31610969/how-to-use-asp-net-identity-with-your-own-custom-table

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!