Share via

.Net Core Owin Packages

pk 5 Reputation points
2024-02-21T09:07:16.3066667+00:00

Team, we have an existing .Net application which is using owin. now we are upgrading to .Net core. But i am getting messages like

Severity Code Description Project File Line Suppression State Warning NU1701 Package 'Microsoft.Owin 4.2.2' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8, .NETFramework,Version=v4.8.1' instead of the project target framework 'net6.0'. This package may not be fully compatible with your project.TokenAuthenticationWEBAPI TokenAuthenticationWEBAPI.csproj 1

Could you please confirm the alternative package for .Net core for the below packages Microsoft.Owin.Host.SystemWeb Microsoft.Owin.Security.OAuth Microsoft.Owin.Cors

Thanks.

Microsoft Security | Microsoft Authenticator
Developer technologies | ASP.NET Core | Other
0 comments No comments

2 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 84,061 Reputation points
    2024-02-21T16:32:36.05+00:00

    Asp.net core has owin middleware support:

    https://learn.microsoft.com/en-us/aspnet/core/fundamentals/owin?view=aspnetcore-8.0

    but as suggested, you are probably better better off replacing the owin middleware with native asp.net core middleware.

    Was this answer helpful?

    0 comments No comments

  2. AgaveJoe 31,361 Reputation points
    2024-02-21T11:05:49.5+00:00

    OWIN is the predecessor to ASP.NET Core where application features are plugged in rather than every framework feature being available to every application. Essentially, you get to pick and choose the features an application supports.

    One of your question seems to be related to token authentication in Web API Core. Token authentication is configured in middleware. The official documentation covers this concept thoroughly.

    Protected web API: Code configuration

    The same applies to CORS. The official documentation illustrates how to handle CORS in an Web API Core application.

    Enable Cross-Origin Requests (CORS) in ASP.NET Core

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.