通过Graph API创建Azure服务主体

问题描述 投票:0回答:1

我能够通过遵循Creating Azure AD application and a service principal using .NET Core (the API and HTTP)中提供的信息来注册应用程序,但是当我使用Postman尝试以下端点时,出现了权限不足错误。

由于我能够使用API​​创建应用,因此我认为这不是权限问题。

POST https://graph.windows.net/{{tenant_id}}/servicePrincipals?api-version=1.6

这样的人:

{
  "appId":"eb167a6d-aaaa-aaaa-aaaa-46e981be37fa"
}

并收到此错误

{
    "odata.error": {
        "code": "Authorization_RequestDenied",
        "message": {
            "lang": "en",
            "value": "Insufficient privileges to complete the operation."
        }
    }
}
azure-active-directory azure-ad-graph-api
1个回答
0
投票

请注意,有两种权限。 委派权限应用程序权限。您可以看到差异here

enter image description here

取决于您用来获取访问令牌的方式。如果您在没有登录用户的情况下获得令牌,则需要使用应用程序权限并授予管理员同意。

© www.soinside.com 2019 - 2024. All rights reserved.