REST API Firestore authentication with ID Token

前端 未结 1 1247
梦谈多话
梦谈多话 2021-01-14 19:25

I have a Firestore DB and one user. I am able to retrieve an ID Token for the user after they sign-in via a request with REST.

I am to use the ID Token with requests

相关标签:
1条回答
  • 2021-01-14 20:06

    According to the Cloud Firestore REST API guide,

    After you obtain either a Firebase ID token or a Google Identity OAuth 2.0 token, pass it to the Cloud Firestore endpoints as an Authorization header set to Bearer {YOUR_TOKEN}.

    So your request should include the header

    'Authorization': `Bearer ${YOUR_TOKEN}`
    
    0 讨论(0)
提交回复
热议问题