简体   繁体   English

如何将ASP.NET Identity与您自己的自定义表一起使用

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

I have a very simple table that has UserID as int Password as text and Roles as text(comma separated). 我有一个非常简单的表,其中UserID为int密码为文本,而Roles为文本(逗号分隔)。 Can i customize ASP.NET Identity structure to use it with my table? 我可以自定义ASP.NET身份结构以与表一起使用吗?

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. 您必须实现IPasswordValidator才能对密码使用任何哈希(我希望它是哈希)。 Also you'll have to implement IUserStore to point to your table. 另外,您还必须实现IUserStore来指向您的表。 And IUserRoleStore also have to be implemented to take roles from your CSV list. 而且还必须实现IUserRoleStore以从您的CSV列表中获取角色。

Here is an overview of the architecture: http://www.asp.net/identity/overview/extensibility/overview-of-custom-storage-providers-for-aspnet-identity 以下是该体系结构的概述: http : //www.asp.net/identity/overview/extensibility/overview-of-custom-storage-providers-for-aspnet-identity

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM