how implement Owin pipeline using Asp.net core - asp.net-core

indeed you can't use third-party tools such as OData, Thinktecture Identity Server, ... in asp.net core application.
So, how we can use these features in asp.net core apps ?
is there any way to implement Owin pipeline beside asp core and have all these facilities too ?

easily you can use Owin pipeline beside Asp.net core, not as an alternative solution.
in this article there is a simple way to implement this architecture using Owin and asp.net core
Implement Owin pipeline using Asp.net Core

Related

OWIN Authentication, Authorization code migration from .net framework to .net 6 (Token based Authentication)

We have implemented OWIN Authorization to our Web Api's in .Net framework project. Now we are migrating this to .Net6. It seems in .net6/.net core owin authentication is not supported.
I don't find any documentation around this.
It seems Microsoft.Owin.OwinMiddleware is not exits in .net core.Also I don't find any Microsoft.Owin.Security.Infrastructure.AuthenticationTokenProvider corresponding nuget packages in .net core.
How can we use OWIN Authorization in .Net core(.net6)? If it is not supported what is alternative to this in .net core
ASP.NET Core using a new authentication middleware which could work like OWIN.
So you could directly using this middleware instead of using owin inside the asp.net core.
For example, if you want to include the MSFT, Goolge, facebook or else, you could refer to this article.

Is Asp.Net Core Identity suitable for Grpc service

We need to build a Grpc service, which must feature users, external login, sign-in/sign-out, roles, etc. We plan to use EF Core for our database, so we consider using ASP.NET Core Identity for all that "user stuff".
Will Grpc work nicely with ASP.NET Core Identity? I just found out that Microsoft suggests not to use their Identity framework for web APIs (mentioned here: https://learn.microsoft.com/en-us/aspnet/core/security/authentication/identity). So did I misunderstand them, or are there pitfalls in that approach?

Is it possible to use an existing ASP.NET Core AuthenticationHandler with ServiceStack?

I have a custom AuthenticationHandler built to tie into the Claims-based authorization in ASP.NET Core. Is it possible for ServiceStack to re-use this component, or will I have to implement it as a custom AuthProvider?
Have a look at the new mvcidentity .NET Core template which shows an example of using ASP.NET identity Auth to protect both MVC and ServiceStack Services.
The integration is enabled with the new NetCoreIdentityAuthProvider which provides a bidirectional adapter that converts between an ASP.NET Core ClaimsPrincipal and a ServiceStack User Session.

ASP.NET Core middleware or OWIN middleware?

As I understand it, ASP.NET Core has support for OWIN middleware (via app.UseOwin()) in addition to its own native middleware.
What is the difference between ASP.NET Core middleware and OWIN middleware?
When designing a new middleware, how do I know if I should design it as a ASP.NET Core middleware or a OWIN middleware?
Your question made me curious and I would like to share, what I have learned so far.
Katana is the implementation of the OWIN spec. After version 3.0 of Katana this technology has been fully integration in the web stack we know as ASP.NET Core today.
While this transition much has stayed similar to the OWIN specifications. Although some changes have been made. In order to use existing OWIN middleware in ASP.NET Core the supports OWIN by an optional feature ("app.UseOwin()").
If you want to target with your middleware ASP.NET apps and ASP.NET core apps, then I would use OWIN middleware. If you want to give ASP.NET Core developers a first class citizen experience, then a ASP.NET Core middleware would be recognized as more "fitting".
Some information about the relationship between ASP.NET Core middleware and OWIN middleware can be found here:
Katana, ASP.NET 5, and bridging the gap
Katana Project
https://docs.asp.net/en/latest/fundamentals/owin.html
I have come to understand it as this; ASP.NET Core middleware is on a higher level than OWIN middleware which is on a lower level.
ASP.NET Core middleware has the advantage that it is much easier to develop a middleware in as you get passed in the HttpContext which you can use. The disadvantage is that the middleware you develop depends on ASP.NET Core.
OWIN is on a lower level and you get a OWIN environment which is a IDictionary<string, object>. The advantage is that is it not tied to ASP.NET hence can run on any OWIN server (such as Nowin). The disadvantage is that it takes more effort to code since you have to build your own context from the OWIN environment or use the OWIN environment dictionary directly and keep track of all OWIN keys and objects.
Edit: You don't have to keep track of OWIN keys yourself, you can use the OwinEnvironment class to get a strongly typed environment.
var environment = new OwinEnvironment(HttpContext);
var features = new OwinFeatureCollection(environment);

ASP.NET Core 1 app migrate to custom OWIN server

I know that asp.net core 1 application supports OWIN specification.So how can i migrate an application to my own custom web server where i will implement catching of http requests and creation of OWIN dictionary manually ?
you should implement owin pipeline beside asp.net core, it's not as an alternative
these two architecture can work beside together properly.
implementation of owin pipeline let you to use tools have not released in asp.net core such as OData, Thinktecture Identity server, ...
you can read this article to implement Owin pipeline
Implement Owin pipeline using Asp.net core
and you can download codes using Github