繁体   English   中英

如何在请求令牌时为 REST 请求在 Azure 存储 Blob 中指定 scope? [AZURE-BLOB][REST API]

[英]How to specify scope in Azure Storage Blob for REST requests while requesting token? [AZURE-BLOB][REST API]

谁能确认要向 Azure 存储发出 REST 请求,我们必须

  1. 创建应用注册并获取其client IDclient secret
  2. 转到API permissions -> Add permission -> Azure storage ,将user_impersonation添加为 API 权限,该权限将允许应用程序代表用户访问已签名的存储帐户。
  3. 转到Access control IAM -> Add role -> 为给定的signed-in user (email)分配您喜欢的任何角色。
  4. 接下来,您现在可以访问令牌以发出请求。

在这个逻辑中,我必须在步骤 3 中授予对角色的read/write/complete-storage-account访问权限,然后将该行为模拟给创建的应用程序。

但是假设我想在令牌请求时授予这些级别的访问权限。 如图所示: 在此处输入图像描述

我可以这样做吗? 我在访问令牌时获得了这些读/写/所有者类型的不同权限。 如果没有,那么我该如何管理不同的访问级别?

  • 我应该使用多个用户吗
  • 我应该使用多个应用程序吗

You don't need multiple applications, but multiple users are needed, when you use the Delegated permission user_impersonation of Azure Storage API ie https://storage.azure.com/user_impersonation in the scope , the app will get all the permissions of the用户登录后存储帐户中的用户。 此外,我注意到您使用https://myaccount.blob.core.windows.net/user_impersonation ,它仅适用于特定的存储帐户,请确保它符合您的要求。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM