Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

How to add OpenIdConnect in .Net 7 Blazor ASP.Net Core Hosted with custom AuthenticationStateProvider?

$
0
0

I've an existing Blazor ASP.Net Core Hosted solution (Client, Server, Shared). It implements custom AuthenticationStateProvider. It does not have “.AddCookie()”. The solution works where users can login and do their things and log out (implemented in Client project).

Now, one of our client wants to add OpenIdConnect, for their security reasons. Our company does not want to force everybody to use OpenIdConnect. Only wants this one client a way to access our site using OpenIdConnect.

How to add OpenIdConnect [OIDC] without affecting existing authentication on .Net 7.0?

In my understanding, while there is already an authentication implemented (Custom AuthenticationStateProvider), cannot add another authentication (OIDC). This question - Crash happening when creating custom AuthenticationStateProvider in hosted Blazor WebAssembly .net 7 app has the same error message I got on browser. However, in my case the custom AuthenticationStateProvider already works. I added OIDC and it is throwing error - my conclusion - cannot have Microsoft.AspNetCore.Components.WebAssembly.Authentication, custom AuthenticationStateProvider together to imlement OIDC.

Then I thought let's add the OIDC to the Server project. I'm not sure how to do that. I want to maintain existing authentication, and add OIDC on ASP.Net Core Hosted .NET 7.0 Blazor. If you can please guide me in the right direction/ sample project/ code, it would be helpful.

I tried few walkthroughs but not able to succeed


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>