12

In Firebase console under Project Settings/General beneath the Project ID field there is a Web API key :

Firebase Web API Key

Where is this used? I know that the Server key found under Project Settings/Cloud Messaging is used as Authorization key to make calls to the firebase console:

Server Key

I have also noticed that in google-services.json ther is an "api_key" property that has a "current_key" value which is different from both keys that I have mentioned. What is that key?

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
DropkickSteve
  • 123
  • 1
  • 7

2 Answers2

7

From my answer here:

  • current key - nothing is explicitly stated anywhere in the docs where it is used, however, among the 3 services where the google-services.json was originally used for before Firebase (Google Sign-in, Analytics, GCM), I'm guessing it would be between Google Sign-in and Analytics. As also mentioned by @DiegoGiorgini here:

The api_key value in google-services.json is not used by FCM. (it is used by other Firebase libraries)

So it can be for a separate Google non-Firebase or Firebase service.

  • Web API Key - this one I haven't had a chance to use before. However, I've seen other posts wherein this specific API key is used often on Web apps related to Firebase (possibly also for Auth purposes?), but I'm not entirely sure.

  • Server Key - as per the docs:

A server key that authorizes your app server for access to Google services, including sending messages via Firebase Cloud Messaging.

Community
  • 1
  • 1
AL.
  • 36,815
  • 10
  • 142
  • 281
  • 14
    This answer sums up the current problems with Firebase: lack of clarity as to what each key is for and whether it is public / private, and where it's actually supposed to be used. This could make all the difference in the world for Firebase developers. – Sam Sep 10 '18 at 20:13
2
  • current_key (as per the docs) is the Android key auto-created by Firebase when creating a Firebase Android App. It's NOT used to control access to backend resources. Instead, it's used to identify your Firebase project when interacting with Firebase/Google services. Specifically, it's used to associate API requests with your project for quota and billing.

  • Web API Key (as per the docs): can be used to authenticate users by passing its value to the key query parameter in several API endpoints, e.g., sign up or sign in using email & password, generate refresh token, etc.

  • Server Key (as per the docs): is a server key that authorizes your app server for access to Google services, including sending messages via the Firebase Cloud Messaging legacy protocols.

Hasan El-Hefnawy
  • 1,249
  • 1
  • 14
  • 20