【发布时间】:2018-01-29 08:32:03
【问题描述】:
在apps.dev.microsoft.com 上配置我的应用程序后,我可以使用管理员帐户登录到带有 MSAL 的移动应用程序。其他用户在从 Microsoft Graph 请求数据时会收到 403 -Forbidden。
应该为用户重新配置什么来授予访问权限?
应用注册范围:
User.ReadWrite
User.ReadBasic.All
Calendars.ReadWrite
Contacts.Read
Android 应用中的范围:
https://graph.microsoft.com/User.ReadWrite
https://graph.microsoft.com/User.ReadBasic.All
https://graph.microsoft.com/Calendars.ReadWrite
https://graph.microsoft.com/Contacts.Read
应用发出的请求:
https://graph.microsoft.com/v1.0/users
https://graph.microsoft.com/v1.0/me/events
https://graph.microsoft.com/v1.0/users/{user}/calendarview
https://graph.microsoft.com/v1.0/me/events/{identifier}
【问题讨论】:
-
澄清一下,是说 MSAL 给了你一个
403或者对 Graph 的调用返回了403? -
使用来自 MSAL 的令牌调用图形返回 403
-
您是否为您提供的每个 URI 或只是其中一些(
/users、/events等)获得了403?另外,您能否添加一些示例代码来展示您如何调用 Graph? -
我收到了 /users 的 403,我需要这些数据来进一步处理
-
所以
User.ReadBasic.All应该覆盖/users。这些范围不应该是必需的,但您是否尝试过获得管理员同意?有关其工作原理的详细信息,请参阅v2 Endpoint and Admin Consent。
标签: android outlook microsoft-graph-api msal