Firebase: Permission denied or sign-up failed

  • ESP32
  • ESP8266
  • Firebase

You may see

Permission denied
permission_denied
ADMIN_ONLY_OPERATION
API key not valid. Please pass a valid API key.
token is not ready

Stay safe: Rules that let anyone read and write are for a short test only. Put proper rules back afterwards.

Why it happens

  • The database rules don't allow it.
  • The sign-in method isn't switched on in the Firebase console.
  • The API key or database address was copied wrongly.

How to fix it

  1. In the Firebase console open Authentication > Sign-in method and enable the one your lesson uses.
  2. Check Realtime Database > Rules.
  3. Copy the Web API key and the database URL again. The URL ends in firebasedatabase.app or firebaseio.com.
  4. Wait for the clock: the first login takes a few seconds.

It worked if: The value appears in the Firebase console.

From the official documentation. From Firebase's security rules and Auth documentation; not reproduced. Sources: Firebase: database rules.

Didn't help? Search another error or ask us.