未找到段用户的资源 - 应用程序令牌 [英] Resource not found for the segment user - Application Token
问题描述
我能够进行身份验证并获取应用程序令牌以使用 Microsoft Graph API.我已设置所有委派和管理员权限以访问用户.我还使用图形资源管理器来验证我需要什么权限:https://developer.microsoft.com/en-us/graph/graph-explorer#
I am able to authenticate and get an application token to use the Microsoft Graph API. I have set all of the delegated and admin permissions to have access to the users. I have also used the graph explorer to verify what permissions I need: https://developer.microsoft.com/en-us/graph/graph-explorer#
我使用他们的 https://graph.microsoft.com/v1.0/me/ 登录时调用.鉴于我正在使用应用程序令牌,因此我必须指定一个用户(见下文).
I verified my user GUID (my ID) through Azure AD as well as the Graph Explorer using their https://graph.microsoft.com/v1.0/me/ call while signed in. Given I'm using the application token so I must specify a user (see below).
这就是我要传递的内容
GET https://graph.microsoft.com/v1.0/user/{my GUID from Azure AD}
Authorization: bearer {myAccessToken}
Content-Type: application/json
我怀疑这是语法问题或权限问题.
I suspect it's a syntax issue or a permissions issue.
推荐答案
网址应该是:
https://graph.microsoft.com/v1.0/users/{GUID}
你应该发送一个:而不是 Content-Type 标头:
And you instead of a Content-Type header, you should send a:
Accept: application/json
这篇关于未找到段用户的资源 - 应用程序令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!