Looking for example of asp.net core web app calling an api both using AAD B2C - asp.net-core

I am fairly new to development and I am looking for an example of an asp.net core web app calling an .net core api both protected by the same Azure AD B2C.
I found examples with 2.2 but I was not able to adapt them to core 3.1.
Thanks

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.

How to login using Windows Authentication in .NET Core with Servicestack

In previous applications using ServiceStack, me and my team have been using .NET Framework and the included AspNetWindowsAuthProvider.
Having switched to .NET Core we have discovered that the included provider is no longer in ServiceStack.Core.
How can I use Windows Authentication in a ServiceStack.Core application?
ServiceStack doesn't have a built-in Windows Auth Provider for .NET Core, a potential solution is to use ASP.NET Core's Identity Auth with ServiceStack, a pre-configured solution is available from the mvcidentity .NET Core Project Template.
Then Configure Windows Authentication in the ASP.NET Core App which is used by the NetCoreIdentityAuthProvider to create an Authenticated ServiceStack Session from the Authenticated ASP.NET Core Identity.

how implement Owin pipeline using 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

How to implement Authentication and Authorization in ASP.NET Web API Core?

We are building ASP.NET MVC core web app and accessing data through ASP.NET Core Web API.
We have to give authentication and authorization to both MVC Core and Web API Core side.
If user is authenticated in MVC core web app then while accessing the data on web API core it is should not again authenticate. If user is directly accessing the web API then it should not allow and ask for authentication.
We also want to give authentication through Google.
For WebAPI I suggest token based authentication, Google support OAuth.
I suggest you take a look at the following link:
https://stormpath.com/blog/token-authentication-asp-net-core
There are some community-led efforts to build rich token authentication functionality for ASP.NET Core:
AspNet.Security.OpenIdConnect.Server – Similar to the OAuth Authorization Server middleware for ASP.NET 4.x.
OpenIddict – Wraps OpenIdConnect.Server up into an easier-to-use package that plugs into ASP.NET Identity.
IdentityServer4 – A port of Thinktecture IdentityServer3 to .NET Core.
All of them have sample MVC and API apps. Enjoy.

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