Share via

How to solve "Insufficient privileges to complete the operation" error when attempting to change a user via Azure REST API?

Jakob Semere 0 Reputation points
2023-12-13T10:48:17.4333333+00:00

I received an error message in response to my attempt to change a user via Azure REST API, specifically "Insufficient privileges to complete the operation." Can someone provide guidance on how to resolve this issue? Here is the information for the HTTP method and URL I used:

HTTP Method: PATCH

URL: https://graph.microsoft.com/v1.0/users/57bd321c-0be1-45a1-8a11-XXXX

Iam using the client credentials flow.

I've also included the Access Token Information in JSON format below.

Access Token Informations
{
  "typ": "JWT",
  "nonce": "LW1zXXX",
  "alg": "RS256",
  "x5t": "T1St-XXX",
  "kid": "T1St-XXX"
}.{
  "aud": "https://graph.microsoft.com",
  "iss": "https://sts.windows.net/a00d85a0-c9b0-41eb-XXX/",
  "iat": 1702XXX,
  "nbf": 1702XXX,
  "exp": 1702XXX,
  "aio": "E2VgYPh28cVl4y6+B7rXt88XXX",
  "app_displayname": "[Sync] - OpenCelium - [PROD]",
  "appid": "01514fb4-XXX",
  "appidacr": "1",
  "idp": "https://sts.windows.net/a00d85a0-c9b0-41eb-xxxx/",
  "idtyp": "app",
  "oid": "e1a6f619-XXXX",
  "rh": "0.AR8XXX",
  "roles": [
    "APIConnectors.ReadWrite.All",
    "DeviceManagementManagedDevices.Read.All",
    "Device.Read.All",
    "User.ReadWrite.All",
    "User-LifeCycleInfo.ReadWrite.All",
    "AdministrativeUnit.Read.All",
    "Directory.ReadWrite.All",
    "IdentityRiskyUser.ReadWrite.All",
    "User.EnableDisableAccount.All",
    "Directory.Read.All",
    "User.Read.All",
    "APIConnectors.Read.All",
    "IdentityRiskyUser.Read.All",
    "User.ManageIdentities.All",
    "AdministrativeUnit.ReadWrite.All"
  ],
  "sub": "e1a6f619-XXX",
  "tenant_region_scope": "EU",
  "tid": "a00d85a0-XXX",
  "uti": "pm0DrjgU9EXXX",
  "ver": "1.0",
  "wids": [
    "fe930be7-XXX",
    "729827e3-XXX",
    "0997a1d0-XXX"
  ],
  "xms_tcdt": 1505478608,
  "xms_tdbr": "EU"
}.[Signature]
Microsoft Security | Microsoft Graph
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.