0

i have the MVC5 web app without authentication

can i create a separated .net core project solely for authentication and hook up to my MVC5 web app?

have searched a lot for solution but most also target to within .net core

Oliver Lim
  • 51
  • 5

1 Answers1

0

can i create a separated .net core project solely for authentication and hook up to my MVC5 web app?

Yes, you can do it. You could create a .Net core application, where you can implement a .Net core Identity, this application will become the central identity API, you could send the user information (UserName and Password) to this API, then, after validation, generate the JWT token, which contains the user identity. Then, in your MVC 5 application, you could configure the authentication and authorization based on the token.

Here are some related articles, you could refer them:

JWT Authentication In ASP.NET Core

ASP.NET Core Web API - Creating And Validating JWT (JSON Web Token)

JWT Bearer Token Authentication & Authorization Front-End in ASP.NET MVC

AspNetCore.Identity in ASP.net MVC 5

Zhi Lv
  • 18,845
  • 1
  • 19
  • 30
  • I recently completed such a project to allow OpenIdConnect using JSON Web Tokens to work across our old .Net Framework sites and our newer Core sites. Core uses a different ChunkingCookieManager to set cookies with than older .NET Frameworks uses. Fortunately there is a shim package Microsoft.Owin.Security.Interop that makes available a compatible ChunkingCookieManager that you can swap in where ever you need it, regardless if your using Owin or not. – Rex Henderson Apr 02 '21 at 03:09