I've been toying around with Firebase, and after reading the documentation (and other SO questions), I'm still confused on some of the API keys. I'm using Firebase for Analytics, Crashlytics, and Performance. But also have it linked to Google Play and AdMob.
When I set it up for the first time, 3 API keys were created in the developer console.
- Browser key (auto created by Google Service)
- Android key (auto created by Google Service)
- Server key (auto created by Google Service)
I tried reading through the documentation to find where it is described how these keys are used, but I wasn't able to find it. From looking around the Firebase application, it looks like the Android Key
is used as the Web API Key
, and the Server Key
is used as the Cloud Message Legacy Server Key
(Although, I don't use Cloud Messaging). I'm not sure how Firebase is using the Browser Key
.
What I'm trying to do is restrict these keys as much as possible to prevent any malicious use of them.
I added the following API restrictions
- Android Key
- Firebase Services API
- Server Key
- Firebase Cloud Messaging API
- Browser Key
- Firebase Services API
I'm not entirely sure if these restrictions are correct for what I am using them for, but it worked for the Android Key
and the Server Key
, at least as far as I can tell. However, the Browser Key
restrictions appear to not work as Firebase is creating a new Browser Key
when I redeploy my application.
To sum up my question, I can see that Firebase is auto creating API keys for me, but I cannot find any documentation that talks about how these keys are used for the basic features of Firebase that I'm using. I'm also not entirely sure how I can restrict these keys, especially the Browser Key
.