Search code examples
firebasefirebase-realtime-databasefirebase-authenticationfirebase-hosting

How to give certain users access to your admin site on firebase?


Background:

In my company, we have one firebase project which is linked to our iOS application and an internal tool(purely for our use and not the consumers). Now since the database is common to both the website and the iOS app, all the users who create an account on the iOS application automatically have access to our internal tool. I wish to allow only a handful of people or one person to have access to the internal tool.

Question:

Is there a way for me to give certain users access to the internal tool? (If it involves manually giving them access from the firebase console?) Is there a way to make the user authentication check different for the internal tool?


Solution

  • Firebase Custom Claims let you specify custom access to database or tools.

    You can specify an admin role to those users who should have access to the admin tool and make sure they have this role in your app's route (or route guard)