Skip to main content
← Data, API & Backend
Data, API & Backend July 6, 2022 · 7 replies

Authentication while connecting to Firestore

Archived from the Bravo community forum (2021–2026). Some answers may refer to older versions of Bravo.

@ and other Bravo experts: We're trying to create an app for our startup, and have the following query:

The front-end is in Bravo, and the back-end is using Firestore. We have set up Firebase auth, how can we use the auth tokens returned by Firebase to query Firestore?

As of now, when we use the URL to access a record in Firestore, it (obviously) gives us a 401 Unauthorized error. Firestore accepts Firebase auth tokens. Please help us with how to access the auth token each time a user logs in to query Firestore!

7 replies

Aayushi July 7, 2022

This was extremely helpful, thanks so much!!

Will we need to make this sign-in request each time a user signs in? If yes, where would you recommend we make this request to obtain the auth token to access firestore?

Aayushi July 8, 2022

we get this error when using the auth key we get back from the documentation you shared:

"API keys are not supported by this API. Expected OAuth2 access token or other authentication credentials that assert a principal. See https://cloud.google.com/docs/authentication" with a 401 code.

Our team is trying to debug this, but can you please help us with this if you have seen this error before? It seems like they need OAuth2 tokens to read user data.

Aayushi July 11, 2022
  • would really appreciate some help on this! Our team has been blocked for a while :/

Wrote something in this thread and want it removed? Request removal

Still stuck?

Ask the community on Discord

This archive is read-only. New questions, office hours and product updates now happen in the Bravo Discord.

Join the Discord