Saas Multitenancy with subdomain

We have a Multi-tenant application where each tenant has its own subdomain (, the tenancy and login are managed by our application with spring security. One unique Database.

Current configuration:
• We have a table with userId, TenantId, User, pass. Despite that, each user must write the URL of the app including the subdomain, and then log in with the user and pass in that tenant.
So one user could be part of more than one tenant we don’t have a unique username or unique email.

I was wondering how is the best approach to use auht0 with universal login using the URL subdomain as information for the login and then show the universal form asking for user and password.


  1. User enters to
  2. Auth0 took the customer1 as information for the login process (I imagine that the tenant info could be a user_metadata)
  3. Auth0 shows the Universal Login where the user must enter credentials: email, pass, or Social Media credentials
  4. Auth0 logs the user to the tenant: customer1, and redirects the user logged to

Could please give me some advice about this approach? I don’t know if this is possible.