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

In a Blazor application, how can I support multiple OIDC authentication providers?

$
0
0

I have built a Blazor standalone webassembly in .NET 9 for a new application that we are building in our company and have successfully integrated it into our Okta system for authentication of the user.

The requirements have now changed and I need to support 2 different Okta integrations, one for internal users on our network and one for external users that will access the application over the internet (the two instances need to be kept separate for security reasons).

The code that I currently have is:

services.AddOidcAuthentication(options =>{    options.ProviderOptions.ResponseType = "code";    options.ProviderOptions.Authority = configuration["Okta:Authority"];    options.ProviderOptions.ClientId = configuration["Okta:ClientId"];    options.ProviderOptions.RedirectUri = Path.Combine(configuration["HubWeb"], "callback");    options.ProviderOptions.DefaultScopes.Add("email");});

I have not been able to find a way in which multiple providers can be configured without writing all of the code myself and having to handle retrieving the tokens etc.

The reason that I am using a standalone webassembly is because my hosting model is to use ROSA (RedHat OpenShift for AWS) and have the Blazor app running as a container, and I have not been able to find a way of sharing the authentication state between the instances of the container.

I am looking for help with understanding if I could use a Blazor web app instead of the standalone webassembly, and if so how to share the authentication state between the instances so that the app continues working if the pod gets restarted due to instability.


Viewing all articles
Browse latest Browse all 4839

Trending Articles



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