【发布时间】:2018-02-21 15:59:47
【问题描述】:
当尝试通过/v1.0/users/{id}?$select=skills获取特定属性(例如skills、aboutMe、responsibilities)时
我收到以下错误消息:
{
"error": {
"code": "-2147024891, System.UnauthorizedAccessException",
"message": "Zugriff verweigert. Sie haben keine Berechtigung, diesen Vorgang auszuführen oder auf diese Ressource zuzugreifen.",
"innerError": {
"request-id": "8a87ee26-b066-42fe-8458-1db74387a47b",
"date": "2018-02-21T15:23:30"
}
}
}
当尝试获取“姓氏”、“邮件”等属性时,没有出现问题,我检索了所需的数据。
我通过 ADAL4J 获得我的令牌:
service = Executors.newFixedThreadPool(1);
context = new AuthenticationContext(AUTHORITY, false, service);
result = context.acquireToken("https://graph.microsoft.com",
new ClientCredential(CLIENT_ID, SECRET), null).get();
String token = result.getAccessToken();
你知道如何在这里设置范围吗?
尝试通过 Postman 请求和范围获取令牌https://graph.microsoft.com/.default 但得到了相同的结果。
我应该使用其他范围来代替.default吗?
注意:我关注了these instructions。
【问题讨论】:
-
您要求的范围是什么?
-
我更新了关于您的范围问题的帖子。
标签: java azure-active-directory microsoft-graph-api