用于访问公共Google云储物存储桶的API密钥

发布于 2025-02-06 00:34:34 字数 96 浏览 3 评论 0原文

我目前有一个公开的存储存储桶,但是我想将对该存储桶的访问限制在具有特定访问键的储物桶中。我想知道是否有一种方法可以在Google Cloud中进行配置,而不是围绕此用例构建服务。

I currently have a storage bucket that is public, however I would like to restrict access to the bucket to those that have specific access keys. I am wondering whether there is a way to configure this in Google Cloud rather than building a service around this use case.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

§对你不离不弃 2025-02-13 00:34:34

api Authentication

OAuth 2.0用于API身份验证和授权。要使用OAuth 2.0向Cloud Storage XML API或JSON API提出请求,请在需要身份验证的每个请求中包含您的应用程序的访问令牌。您可以从OAuth 2.0游乐场生成访问令牌:

  1. 在OAuth 2.0操场中,单击Cloud Storage API V1,然后为您的应用程序选择一个访问级别(Full_Control,read_only或Read_Write)。

    )。

  2. 单击授权API。

  3. 提示时登录您的Google帐户。在出现的对话中,单击“允许”。

  4. 在操场的步骤2中,单击出现的授权代码的令牌交换授权代码。

  5. 复制您的访问令牌,并将其包含在您的请求的授权标题中:

授权:BEARER OAUTH2_TOKEN

用于完整指南和其他参考,您可以在下面:

云存储身份验证

API authentication

Cloud Storage uses OAuth 2.0 for API authentication and authorization. To make requests using OAuth 2.0 to either the Cloud Storage XML API or JSON API, include your application's access token in the Authorization header in every request that requires authentication. You can generate an access token from the OAuth 2.0 Playground:

  1. In the OAuth 2.0 Playground, click Cloud Storage API v1, and then select an access level for your application (full_control, read_only, or read_write).

  2. Click Authorize APIs.

  3. Sign in to your Google account when prompted. In the dialogue that appears, click Allow.

  4. In Step 2 of the playground, click Exchange authorization code for tokens for the authorization code that appears.

  5. Copy your access token and include it in the Authorization header of your request:

Authorization: Bearer OAUTH2_TOKEN

For full guide and other reference you can on below:

Cloud Storage authentication

Setting up authentication

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文