Dynamic white label login page by domain with dynamic signIn options

Hey folks. My current task is to create a dynamic login page for different clients and different users through our internal subscription system. And white label it by client

The requirements are:

  • White label based on the domain
  • Different login options based on the company or user subscription. Meaning as user Foo in company A you might log in with a password/email and google SSO. And as user Bar in company B might have only a password/email login.

Current implementation

  • On FE app we are using a library @auth0/auth0-react with loginWithRedirect
  • On BE, which is dedicated to communication with FE via websocket. We use library auth0, to validate the user with accessToken for establishing the connection. Meaning the domain and clientId must be matching for both of them

My question is: What is the simplest way how to create a white labeled loginWithRedirect with dynamic login options (e.g.: with or without SSO) for company/user. Without creating a new tenant and new db connection for each case? Also, it is quite tricky to connect the FE and BE credentials (domain and clientId) dynamically based on the client’s request.

1 Like

Since there is no response from the community. Here are our findings:

There is no easy way to switch auth0 credentials by domain with @auth0/auth0-react. We managed to do it by creating a custom auth0 wrapper component where we can switch different auth options. After all the pain with it, I would maybe suggest looking into https://auth0.com/docs/libraries/lock but this has its own set of problems and limitations.

Also one of our requirements was to use custom domains for different clients. That is possible ONLY with multiple tenants. That is currently NOT possible with an essentials plan or professional plan. Basically, without an enterprise plan, we end up with only one tenant and one custom domain. If we would like to use more tenants, auth0 requires to have an enterprise plan for a rather substantial amount of money (cca 30k$ / year).

So heads up, since the limitations about domains and tenants are not really written anywhere and the overall pricing page is a bit confusing with the intention to force you to contact sales. With those findings, I would suggest spending more time looking for other than auth0 solutions if you need to work with custom domains and don’t have a corporation budget