0

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.

Background on the problem.

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.

Camp
  • 97
  • 11
  • `to authenticate and authorize users` Are you trying to implement SSO? – Win Aug 23 '18 at 18:43
  • ASP.NET MVC has its own version of Identity, which is what you'll need to utilize if you want the auth integrated in to that particular web app. However, you can also implement IdentityServer and use that for your auth. That then would utilize AspNetCore.Identity, and your MVC app would simply auth via something like OpenID Connect, essentially abstracting away the Identity dependency. – Chris Pratt Aug 23 '18 at 18:59
  • I am not trying to implement SSO, as stated I am told not to use IdentityServer. MVC Identity is Identity 2.0 not Identity Core so it was not working the columns did not match and there was an issue with a discriminator within Identity as well. – Camp Aug 24 '18 at 13:39
  • @Camp what was the work flow between the applications before? – Anton Toshik Aug 24 '18 at 19:22

1 Answers1

1

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

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.

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.

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.

  • Thank you, I have already started creating a API to handle the flow between the applications and it is working well. I appreciate the help! – Camp Aug 27 '18 at 15:34