【问题标题】:Authorization Permission Mismatched error in Postman邮递员中的授权权限不匹配错误
【发布时间】:2022-11-25 21:04:36
【问题描述】:

我创建了一个 Azure AD 服务主体并生成令牌,我正在使用客户端凭据流:

POST https://login.microsoftonline.com/tenantID/oauth2/token
 &client_id = redacted
 &grant_type = client_credentials
 &resource = https://storage.azure.com
 &client_secret = redacted

令牌生成成功,但当我尝试列出我的存储帐户中的容器时,它抛出了授权权限不匹配的错误。

为了列出容器,我使用了以下查询

 GET https://storageaccname.blob.core.windows.net/?comp=list

错误详情:

<?xml  version="1.0"  encoding="utf-8"?>
<Error>
<Code>AuthorizationPermissionMismatch</Code>
<Message>This request is not authorized to perform this operation using this permission.
RequestId:
Time:2022-11-20T08:12:24.9827677Z</Message>
</Error>

我不确定在我发现一些谷歌搜索后我缺少什么权限存储 Blob 数据贡献者角色是必须的。我将此角色分配给了我创建的服务委托人。

但仍然是同样的错误,有什么解决方法可以解决我的问题吗??

【问题讨论】:

    标签: azure postman azure-storage


    【解决方案1】:

    我试图在我的环境中重现相同的内容并得到如下相同的错误:

    GET https://StorageAccName.blob.core.windows.net/?comp=list
    

    检查是否已分配Storage Blob Data Contributor Role给服务负责人,如下所示:

    转到 Azure 门户 -> 存储帐户 -> 您的存储帐户 -> 访问控制 (IAM) -> 添加角色分配

    要解决错误,请尝试使用生成令牌v2.0 令牌端点如下所示:

    POST https://login.microsoftonline.com/Tenant_ID/oauth2/v2.0/token
     &client_id = Client_ID
     &grant_type = client_credentials
     &resource = https://storage.azure.com
     &client_secret = Client_Secret
    

    使用上面生成的访问令牌,我能够成功获取容器列表如下所示:

    【讨论】:

      猜你喜欢
      • 2017-02-23
      • 2018-07-01
      • 2018-09-22
      • 1970-01-01
      • 2020-09-17
      • 2023-03-07
      • 2019-11-09
      • 2021-01-24
      • 1970-01-01
      相关资源
      最近更新 更多