我怎么知道我需要为Microsoft Identity Platform/Azure AD/MSAL应用设置哪些权限?
我知道如何在Azure AD中注册全部。我也知道如何使用MSAL检索访问令牌。当我提出请求时,我会收到此错误:
$ curl https://graph.microsoft.com/v1.0/me -H "Authorization: Bearer ${ACCESS_TOKEN}"
{
"error": {
"code": "ErrorInsufficientPermissionsInAccessToken",
"message": "Exception of type 'Microsoft.Fast.Profile.Core.Exception.ProfileAccessDeniedException' was thrown.",
"innerError": {
"date": "2022-06-11T18:41:12",
"request-id": "c5af5903-d4d1-4a6c-bdf4-9c059f865345",
"client-request-id": "c5af5903-d4d1-4a6c-bdf4-9c059f865345"
}
}
}
有没有办法知道您需要从错误消息中设置哪些API权限和范围?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
设置API权限和范围取决于您要调用Microsoft Graph的请求。
您可以通过 microsoft Graph Rest REST REST API V1.0参考/a>
在调用
/me
端点时检查下面的注意:必需 permissions 用于调用
/strong> me
端点是:我在环境中测试并得到了概要符合下面的授权权限,如下所示:
API权限 我给了该应用程序:
您可以找到类似的 Microsoft Q& a 下面提出的问题:
Setting up API permissions and scopes depends on the request you are making to call Microsoft Graph.
You can find the required permissions for every Graph API request via Microsoft Graph REST API v1.0 reference
Check the below note while calling
/me
endpoint :Required permissions for calling
/me
endpoint are:I tested in my environment and got the profile successfully with Delegated permission like below:
API Permissions that I have given to the app:
You can find similar kind of problem raised in Microsoft Q&A below:
ErrorInsufficientPermissionsInAccessToken - Microsoft Q&A