Firestore Custom Tokens

前端 未结 1 338
一生所求
一生所求 2020-12-12 03:47

I am trying to use a custom auth token with firestore. I am using nodejs to generate the token with the following code.

const admin = require(\'firebase-admi         


        
相关标签:
1条回答
  • 2020-12-12 04:26

    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:

    • Sign in from a Firebase Client SDK
    • Use the Firebase Auth REST API to exchange the custom token to an ID token.

    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

    0 讨论(0)
提交回复
热议问题