Hi, I need to fetch data from firebase. To do that, i need access_token (I dont want to use firebase secret which is deprecated).
How can i generate firebase access token using serviceaccount file which i generated from Firebase?
Thanks,
Prabhat
Solved! Go to Solution.
Hi Prabhat!
Here's a repo of a working API Proxy that shows an example for doing exactly that.
If you have a service account file like this:
{ "type": "service_account", "project_id": "YOUR-PROJECT-NAME", "private_key_id": "bdb91206c515893e1f6815e6b80bff113f92a1a0", "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADAN.......FRPE=\n-----END PRIVATE KEY-----\n", "client_email": "YOUR-PROJECT-NAME@appspot.gserviceaccount.com", "client_id": "10ee87dh4855500679513", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "token_uri": "https://accounts.google.com/o/oauth2/token", "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/blah-blah-blah@gserviceaccount.com" }
...then you can use this proxy to connect.