向现有项目添加身份 [英] Adding Identity to an existing project

查看:68
本文介绍了向现有项目添加身份的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个MVC项目,我想在其中添加Identity,但是我似乎找不到任何有关如何执行此操作的好文章.

I've got an MVC project, and I want to add Identity to it, but I can't seem to find any good articles on how to do so.

是否有一种简单的方法可以将Identity添加到现有项目中?

Is there an easy way to add Identity to an existing project?

我已经有一个包含东西的数据库

I already have a database with stuff in it

推荐答案

好的,一方面,您只需添加Nuget包并开始使用它编写代码,但我认为您可能正在谈论所有其他功能:用于执行密码重置,两因素身份验证等操作的预先编写的代码和示例.

Well, in one respect, you simply have to add the Nuget package and start writing code with it, but I think you're probably talking about all the extras: the pre-written code and samples for doing things like password resets, two-factor auth, etc.

为此,不,实际上并没有 easy 的方式,至少在单击按钮并前进的意义上.我建议您使用个人身份验证创建一个新的MVC 5项目,然后添加 Identity Samples的Nuget程序包.然后,在另一个Visual Studio窗口中打开现有项目,然后复制/粘贴或将示例代码用作编写自己的示例的指南.

For that, no, there's not really an easy way, at least in the sense of click a button and go. What I would recommend is creating a new MVC 5 project with Individual Auth, and then adding the Identity Samples Nuget package to it. Then, open your existing project in another Visual Studio window and copy/paste or use the sample code as a guide for writing your own.

这篇关于向现有项目添加身份的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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