使用带有自定义表的aspnet标识 [英] using aspnet identity with custom tables

查看:63
本文介绍了使用带有自定义表的aspnet标识的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究asp.net MVC核心应用程序.我有带有用户和角色表的自定义数据库.我想在自定义表中使用asp.net身份,这样就不必使用aspnetusers和aspnet角色表.如何使用asp.net身份和asp.net核心

I am working on asp.net MVC core application. I have custom database with users and roles tables. I want to use asp.net identity with custom tables so that I don't have to use aspnetusers, aspnet roles tables. How to do it with asp.net identity and asp.net core

推荐答案

祝您好运! :) 我最近几天经历了这个过程.我已经开始使用它了,但是在某些阶段确实很痛苦.

Good luck with that! :) I have just gone through that process last few days. I've got it to work but its really painful at some stages.

简而言之:

  1. 您需要创建自己的实现IUser界面的用户模型.
  2. 您需要创建自己的DAL,以从自定义数据库表中获取数据
  3. 您需要实现自己的UserStore,该UserStore根据要使用的asp.identity的功能来实现不同的接口

此链接将帮助您: https://www. asp.net/identity/overview/extensibility/overview-of-custom-storage-providers-for-aspnet-identity

这篇关于使用带有自定义表的aspnet标识的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆