我'm trying to set up a sign-on process for an internal company web app using the Azure AD and Microsoft Graph. I want to manage security groups in the AD, so when a user signs in via OAuth, I'正在对https://graph.microsoft.com/v1.0/me/memberOf执行GET请求以查看已登录用户所在的组 . 用户具有相应的范围以查看此信息,并且它在图形浏览器中工作,但是当我在PHP应用程序中进行调用时,我得到一个格式错误的JSON响应:
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#directoryObjects",
"value": [{
"@odata.type": "#microsoft.graph.group",
"objectType": "Group",
"objectId": "blahblah2",
"deletionTimestamp": null,
"description": "Users who have access to my web app's administration",
"dirSyncEnabled": null,
"displayName": "Web App Administrators",
"lastDirSyncTime": null,
"mail": null,
"mailNickname": "blahblah2",
"mailEnabled": false,
"onPremisesSecurityIdentifier": null {
"error": {
"code": "InternalServerError",
"message": "Unsupported extension property type.",
"innerError": {
"request-id": "blahblah3",
"date": "2016-02-29T09:42:18"
}
}
}
......这就是我得到的!
https://msdn.microsoft.com/en-us/library/azure/ad/graph/api/entity-and-complex-type-reference#GroupEntity的文档说这个onPremisesSecurityIdentifier字段与on-premesis同步有关,但我从未使用过 .
1 回答
您的请求附加了api-version查询参数(即/v1.0/me/memberOf?api-version=1.6) . 请删除该查询参数 . Microsoft Graph通过URL路径中的第一个段识别API版本,例如: https://graph.microsoft.com/v1.0/me/memberOf或https://graph.microsoft.com/beta/me/memberOf