Search code examples
google-cloud-firestoretoken

Firestore token with Postman?


I realize that this question has been asked a few times but I don't think it has been answered. I need to get a bearer token for firestore. I can get it using a command line gcloud statement perfectly well, no problem. But I need to do it within postman as a request. What are the steps to get a token from a firestore DB with postman, specifically?


Solution

  • You can use Postman to perform the following steps to get a bearer token for Firestore:

    1. Create a new request in Postman.
    2. Input the request URL field: https://www.googleapis.com/oauth2/v4/token
    3. Choose the x-www-form-urlencoded option under the request body tab.
    4. In the Key field, enter grant_type.
    5. In the Value field, enter urn:ietf:params:oauth:grant-type:jwt-bearer.
    6. In the Key field, enter assertion.
    7. In the Value field, enter the JWT token you generated.
    8. Set the request method to POST.
    9. Click the "Send" button to send the request to the server.
    10. The server should respond with a JSON object containing the access token in the "access_token" field.
    Keep in mind that getting an authorized token requires having the appropriate permissions and authentication setup. Additionally, confirm that the JWT token you generated has the appropriate scopes and permissions needed to access the Firestore DB.