ASP.net MVC 5中的AspNetCore.Identity [英] AspNetCore.Identity in ASP.net MVC 5

查看:69
本文介绍了ASP.net MVC 5中的AspNetCore.Identity的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否甚至可以在非核心应用程序(例如MVC 5 .net Framework应用程序)中设置和使用AspNetCore.Identity?我已经尝试了一段时间,但似乎没有用.如果有人知道某个教程或其他很棒的东西,或者只是让我知道这是行不通的.

Is it even possible to set up and use AspNetCore.Identity in a non core application like a MVC 5 .net Framework application? I have been trying for awhile now and it doesn't seem to work. If anyone knows of a tutorial or something else that would be great, or just let me know that it cant be done.

问题的背景.

我使用的成员身份继承了一个已有20年历史的登录应用程序,该成员身份正在开发中,并且已更新为.net core 2.0和Identity.我还有其他应用程序,然后需要使用此核心应用程序来认证和授权用户.我想使用身份服务器或类似的开放源代码,但是必须遵循的规则我不能.因此,我试图在MVC应用程序中使用MVC 5中提供的功能进行设置.

I inherited a 20 year old login application using membership that I have in development updated to .net core 2.0 and Identity. I have other applications that then need to use this core application to authenticate and authorize users. I wanted to use Identity server or something open source like that but the rules I have to go by say I cannot. So I am trying to set this up in a MVC application with functions available in MVC 5. Anything helpful is appreciated.

推荐答案

甚至有可能在非MVC 5 .net Framework应用程序之类的核心应用程序?

Is it even possible to set up and use AspNetCore.Identity in a non core application like a MVC 5 .net Framework application?

否,因为它不兼容. Asp.Net Identity 3是专门为Asp.Net Core编写的.而且由于Asp.Net Core进行了重大更改,因此您不能将Asp.Net Identity 3与Asp.Net 4.x一起使用.

No, as it is not compatible. Asp.Net Identity 3 has specifically been written for Asp.Net Core. And because Asp.Net Core has major changes you cannot use Asp.Net Identity 3 with Asp.Net 4.x.

另一种方法是将功能提取到一个单独的新的asp.net核心项目中.您可以在其中实现Identity Framework3.这将成为中央身份api.从您的MVC 5项目中调用此api.

The alternative is to extract the functionality into a seperate, new asp.net core project. Where you can implement Identity Framework 3. This will become the central identity api. And from your MVC 5 projects call this api.

在mvc 5项目中,您可以创建所需的令牌,同时由api进行标识和管理.我已经在此处中描述了这个想法.

In the mvc 5 project you can create the desired tokens, while identification and management is done by the api. I've described the idea in my answer here.

这篇关于ASP.net MVC 5中的AspNetCore.Identity的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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