The docs state:
One of the following scopes is required to execute this API: Directory.ReadWrite.All OR Directory.AccessAsUser.All
http://jwt.calebb.net/ confirms that Directory.ReadWrite.All is one of the roles for my token, however the following request:
POST https://graph.microsoft.com/v1.0/directoryRoles/{directoryRoleObjectId}/members/$ref
{
"@odata.id": "https://graph.microsoft.com/v1.0/directoryObjects/{userObjectId}"
}
Returns:
{
"error": {
"code": "Authorization_RequestDenied",
"message": "Insufficient privileges to complete the operation.",
"innerError": {
"request-id": "{id}",
"date": "2016-11-25T15:18:07"
}
}
}
Running a GET on the directoryRole returns data, so the Read permissions seem to be working. What am I missing?