Base solution for your next web application
Open Closed

How can I enable both okta and auth0 for a tenant using openid #12204


User avatar
0
kansoftware created

I want to enable both okta and auth0 for a single tenant as some users may login through okta and some through auth0. I am having a multitenant application. Do I need to custom the code or there is a functionality in the base code. Could you please help me out how can I achieve that


6 Answer(s)
  • User Avatar
    0
    oguzhanagir created
    Support Team

    Hi kansoftware

    To enable both Okta and Auth0 for a single tenant in your multi-tenant application, you will need to customize the code, as the standard ASP.NET Zero implementation typically supports only one OpenID Connect provider per tenant.

  • User Avatar
    0
    kansoftware created

    Hi kansoftware

    To enable both Okta and Auth0 for a single tenant in your multi-tenant application, you will need to customize the code, as the standard ASP.NET Zero implementation typically supports only one OpenID Connect provider per tenant.

    Ok. For now I have enabled okta through oidc. I have added the default options in startup.cs. But also I have configured the openid for a tenant through tenant settings page. I want to know how and where does it replaces the client id and other details before redirecting to okta login page.

    As for my custom code I want to set the credentials runtime because for each tenant it will be different. I hope I am making sense

  • User Avatar
    0
    kansoftware created

    I want to set OpenIdConnectOptions during runtime for tenant. Is it possible if yes then how?

  • User Avatar
    0
    maliming created
    Support Team

    hi

    These classes allow you to change the options at runtime. They get tenant settings values( from the database).

    In fact, you can add multiple OpenIdConnect as authentication providers.

    authenticationBuilder.AddOpenIdConnect("Auth0", options => ...
    
    authenticationBuilder.AddOpenIdConnect("Okta", options =>
    

    The name is the Auth0 or Okta

  • User Avatar
    0
    kansoftware created

    Can I call these function on login button in Account controller to set options at runtime? If yes then how

  • User Avatar
    0
    maliming created
    Support Team

    hi

    Yes, See https://github.com/aspnetzero/aspnet-zero-core/commit/7541fa92769e0ff340ccfb9424a5f58c62ca1c08