GETting /me/memberOf 时格式错误的 JSON 响应(Microsoft Graph)
Malformed JSON response when GETting /me/memberOf (Microsoft Graph)
我正在尝试使用 Azure AD 和 Microsoft Graph 为公司内部 Web 应用程序设置登录过程。我想管理 AD 中的安全组,因此当用户通过 OAuth 登录时,我正在向 https://graph.microsoft.com/v1.0/me/memberOf 发出 GET 请求以查看登录用户所在的组。用户具有适当的范围查看此信息,它在 Graph Explorer 中工作,但是当我在我的 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 同步有关,但我从未使用过它。
您的请求附加了 api-version 查询参数(即 /v1.0/me/memberOf?api-version=1.6)。请删除该查询参数。 Microsoft Graph 通过 URL 路径中的第一段识别 API 版本,例如https://graph.microsoft.com/v1.0/me/memberOf or https://graph.microsoft.com/beta/me/memberOf
我正在尝试使用 Azure AD 和 Microsoft Graph 为公司内部 Web 应用程序设置登录过程。我想管理 AD 中的安全组,因此当用户通过 OAuth 登录时,我正在向 https://graph.microsoft.com/v1.0/me/memberOf 发出 GET 请求以查看登录用户所在的组。用户具有适当的范围查看此信息,它在 Graph Explorer 中工作,但是当我在我的 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 同步有关,但我从未使用过它。
您的请求附加了 api-version 查询参数(即 /v1.0/me/memberOf?api-version=1.6)。请删除该查询参数。 Microsoft Graph 通过 URL 路径中的第一段识别 API 版本,例如https://graph.microsoft.com/v1.0/me/memberOf or https://graph.microsoft.com/beta/me/memberOf