Firestore在Postman中的令牌?

huangapple go评论74阅读模式
英文:

Firestore token with Postman?

问题

我需要在Postman中的Firestore请求中获取一个Bearer令牌。请问如何在Postman中获取Firestore数据库的令牌?

英文:

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?

答案1

得分: 0

你可以使用Postman执行以下步骤来获取Firestore的令牌:

  1. 在Postman中创建一个新的请求。
  2. 在请求URL字段中输入:https://www.googleapis.com/oauth2/v4/token。
  3. 在请求体选项卡下选择x-www-form-urlencoded选项。
  4. 在键字段中输入grant_type。
  5. 在值字段中输入urn:ietf:params:oauth:grant-type:jwt-bearer。
  6. 在键字段中输入assertion。
  7. 在值字段中输入你生成的JWT令牌。
  8. 将请求方法设置为POST。
  9. 点击“发送”按钮将请求发送到服务器。
  10. 服务器应该会以JSON对象的形式响应,其中包含在“access_token”字段中的访问令牌。

请记住,获取授权令牌需要具有适当的权限和身份验证设置。另外,请确认你生成的JWT令牌具有访问Firestore数据库所需的适当范围和权限。

英文:

<p style="margin: 0;">You can use Postman to perform the following steps to get a bearer token for Firestore:</p>
<ol>
<li>Create a new request in Postman.</li>
<li>Input the request URL field: https://www.googleapis.com/oauth2/v4/token&lt;/li>
<li>Choose the x-www-form-urlencoded option under the request body tab.</li>
<li>In the Key field, enter grant_type.</li>
<li>In the Value field, enter urn:ietf:params:oauth:grant-type:jwt-bearer.</li>
<li>In the Key field, enter assertion.</li>
<li>In the Value field, enter the JWT token you generated.</li>
<li>Set the request method to POST.</li>
<li>Click the "Send" button to send the request to the server.</li>
<li>The server should respond with a JSON object containing the access token in the "access_token" field.</li>
</ol>
<p style="margin: 0; ;margin: 0;">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.</p>

huangapple
  • 本文由 发表于 2023年4月13日 22:34:25
  • 转载请务必保留本文链接:https://go.coder-hub.com/76006693.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定