Search code examples
firebasegoogle-cloud-platformfirebase-authenticationgoogle-cloud-identity

View authenticated users in Firebase Emulator when using multi tenancy


A project that we are building uses the Google cloud identity toolkit multi-tenant feature. We have two tenants that we are actively using. We interact with all of this through Firebase's authentication suite.

I've noticed that when using this the user accounts do not show up in Firestore's UI anymore. The same goes for the local emulator.

I know the user has been created because when I log in I get back the correct uid matching the user profile created in firestore that I can see in the local emulator.

I'd like to know if anyone can help me with one of the following:

  1. Is there a way to manage the users created for a multi-tenant setup through the emulator?

  2. Is there a way for me to use gcloud cli locally to manage the users that I have created locally?


Solution

  • Good news! The updated version of the emulator will show you tenants. Once you run the emulator, attempt to login as a user through a tenant, and your "auth" page will magically get a "Tenant" dropdown.

    Bad news! The non-default-tenant users don't seem to persist by any export method I have discovered so far.

    As for seeing those users in the firebase console, it's pretty easy, but an extra step. Under "authentication" in the firebase console, you should see a tenant dropdown.

    Image you'll see

    If you open that, there will be a link "Other tenants can be managed in the Google Cloud Console". Click it, then click "users" on the left. Finally choose your tenant in the "Tenant" dropdown.

    enter image description here