How to generate a new Firebase ApiKey

16.5k Views Asked by At

I shared my project (with the ApyKey) with serverall people. Now I was wondering if it is possible to generate a new ApiKey so I know, I'm the only-one who can access my Firebase project?

enter image description here

5

There are 5 best solutions below

0
On BEST ANSWER

If you would like to have a special key for use in a server, then you can generate one by navigating to the firebase console for your project, selecting the gear in the top left hand corner and selecting project settings. Then select service accounts at the top. Then select Firebase Admin SDK and then generate new private key. Hope this helps!

2
On

It's supposed to be like that. Firebase has security rules for protecting the data. https://firebase.google.com/docs/database/security/quickstart https://firebase.google.com/docs/storage/security/start

You can set the rules from the Firebase Console, under (Project --> Database/Storage -->Rules) like this:

{
  "rules": {
    ".read": "auth != null",
    ".write": "auth != null"
  }
}

Unless the users are authenticated, they can neither read nor write data to the database/storage.

0
On

Firebase is a client side service. As soon as you use firebase in production that key will become public. Your key isn't meant to be private, your database and storage security rules should be used to secure your data private.

1
On

Any project created on firebase will be present in google cloud also.

You can regenerate the "web API Key" of a firebase from google cloud.

enter image description here

If this is the web API key you want to regenerate, read on!

  1. Go to google cloud -> open your console -> select your project

enter image description here

If you don't find your project under the "RECENT" tab, lookout in the "ALL" tab.

enter image description here

  1. Go to "APIs & Services"/"Credentials" from navigator

enter image description here

  1. Select to edit the key which you want to update/regenerate.

enter image description here

  1. Regenerate your key from here.

enter image description here

And you are done! Once you refresh firestore, you will see the new key in your settings.

** The new key will be available immediately. The current key will be deactivated permanently in 24 hours.

1
On

Here's the answer I found that actually created a new web API key, effectively disabling the old one.

Regenerate Web API key of Google Firebase