Alex Zaitsev
Alex Zaitsev

Reputation: 1781

how to make authenticated requests to Firebase Realtime Database with api key

What I want is to perform rest requests to Firebase Realtime Database from my esp8266 with micropython firmware without complex authorization process.
I know that I can turn off authorization at all in the rules but I'd prefer to have at least some basic security.

Can't I just use my Web API Key for this purpose? project settings

Here is a doc which tells that there are 2 ways of authentication: oauth2 and generating key manually. Second way seems almost what I need but it requires setting up Admin SDK and as far as I understood still requires regenerating the key from time to time.

So eventually I have no answer to a simple question: how to authenticate rest requests to the Firebase Realtime Database in the most simple way?

Upvotes: 2

Views: 1681

Answers (1)

Frank van Puffelen
Frank van Puffelen

Reputation: 598740

The same page you linked to contains a section on using legacy tokens (also known as "database secrets" in the past). While those are not recommended anymore, they continue to work and are as simply as adding the (non-dynamic) database secret to your URLs.

I suggest you read the links at the bottom of the documentation. But I do recommend that you switch to using the OAuth or ID Token flows as those are much more secure.

Upvotes: 3

Related Questions