简体   繁体   中英

Add Identity after creating an MVC website in VS2015

when I create an MVC website in VS2015 I can select Individual Identity, so the project will come with all the Account stuff.(like Login, logout, [Authorize] ...)

the question is: if I just created a new Project with choosing: no Authentication. and I wanted to add the Account stuff.

is there a way to do it automatically without the need to write everything from scratch? (specially the Authorize Attribute and register it in Principal)

And if not, what ist the easiest way to do a simple login?

thank you.

It can be done, If you're looking for Microsoft Identity it's available as a nuget package: https://www.nuget.org/packages/Microsoft.AspNet.Identity.Owin/

But be aware that installing it this way will not auto generates all the stuff the project template does you'll have to do some manual implementation. I recommend making a new site with Authentication and look at it to see what's missing and need to be added manually.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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