I have an Angular app that currently uses Firebase auth and Firebase hosting. I'm considering moving to Google Identity Platform with multi-tenancy. In this scenario a tenant ID must be passed to the auth object in the Angular app.
My question is how we can find the appropriate tenant ID dynamically. If we used subdomain names or paths in the Angular app to distinguish between tenants, we would need to map from those human-friendly names to the Google Identity Platform tenant ID. For example, a subdomain might be:
tenantname.mysite.com
But the tenant ID would be something like
tenantname+some_random_string
Is there a way to do this securely, given that the user hasn't logged in yet, so we can't use e.g. an authenticated API call, or a map on a database with Firebase security rules?
The Google docs suggest allowing the user to choose from a list but that solution doesn't work for us.