In an old project we used ASP.NET 4.5 and I would like to use the Framework OpenIdDict in it. It's made vor ASP.NET Core 1 and 2. Can I still use it? What do I have to pay attention to? If I can't use that, which alternatives do you know?
Link to OpenIdDict: https://github.com/openiddict/openiddict-core
Edit: OpenIddict 3.0 is now natively compatible with OWIN/Katana and can be used in any >= ASP.NET 4.6.1 application without using any adapter. Read these two blog posts for more information:
Technically, it's possible to use middleware designed for ASP.NET Core 1.x/2.x in an ASP.NET 4.x application by using the
Microsoft.AspNetCore.Owin
adapter package and some tweaking.Here's a prototype of an OWIN self-hosted console application (it would be very similar with an ASP.NET 4.x application using the OWIN
SystemWeb
host):Program.cs:
Startup.cs:
KatanaExtensions.cs:
OpenIddictExtensions:
In practice, I wouldn't recommend it as it's a bit hackish (the
Microsoft.AspNetCore.Owin
adapter hasn't been updated for years). Instead, you may want to adopt a micro-service architecture and move your OpenIddict-based authorization server to a separate ASP.NET Core service.