Closed yeldarby closed 1 year ago
@yeldarby I think you can't directly access REST APIs with a custom token. You need to sign in using the custom token, and obtain an ID token There are 2 ways to do this:
Then you can access the Firestore REST API with the resulting ID token:
https://firebase.google.com/docs/firestore/use-rest-api#working_with_firebase_id_tokens
@yeldarby any update from your side?
We ended up using RTDB for the time being since Pyrebase liked these tokens.
I definitely still want to figure out if Firestore is an option for us though so I'll circle back later this week or early next to test what you recommended.
@HemangChothani Is there any library on python that connects the user to the firestore with this proper credentials? I can't find a library that doest that, which is easily made on front-end languages such as javacsript
For all Firebase libraries: https://firebase.google.com/docs/firestore/client/libraries For integrations: https://firebase.google.com/docs/firestore/library-integrations
If you are still having trouble with this after following Hemang's example, please file a new issue. Thanks!
Environment details
google-cloud-firestore
version: 1.6.2Steps to reproduce
Get a token minted with the
firebase_admin
and try to use it withpython-firestore
I think it's possible this is not the right type of token to use with
google.oauth2.Credentials
(but I can't find anywhere in the docs how to operate the Python library in user mode with the generated token if this isn't it.)Code example
Generate a token:
Code taken from here
Try to use it somewhere else
Stack trace