SharePoint / SharePoint/sp-dev-docs

Graph Endpoints that require administrative roles not working

Open
#10,237 8 comments 0 reactions 1 assignee View on GitHub

@Ashlesha-MSFT is already working on this.

Since May 7, 2025.

sharepoint-developer-support type:bug-suspected
Dominant language
PowerShell
Stars
1.4k
Forks
1.1k
Avg merge
4d 12h
Merged PRs (30d)
12

Description

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

💥 SharePoint Framework

Developer environment

None

What browser(s) / client(s) have you tested
  • 💥 Internet Explorer
  • 💥 Microsoft Edge
  • 💥 Google Chrome
  • 💥 FireFox
  • 💥 Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)
Additional environment details

SPFx 1.17.2
Chrome Version 119.0.6045.200 (Official Build) (64-bit)

Describe the bug / error

I'm having an interesting issue, when I'm using the MSGraphClientV3 in SPFx the following call fails:

PATCH https://graph.microsoft.com/v1.0/admin/people/profileCardProperties/UserPrincipalName

BODY

{
    "annotations": [
        {
            "displayName": "UPN",
            "localizations": [
                {
                    "displayName": "Test122",
                    "languageTag": "ar-TN"
                }
            ]
        }
    ]
}

I get an 403 Forbidden

Response

{
    "error": {
        "code": "UnknownError",
        "message": "",
        "innerError": {
            "date": "2023-12-04T12:35:12",
            "request-id": "18740317-0dd0-4bd9-abf6-cb28e777c11e",
            "client-request-id": "7b1ef20a-fc9d-64d3-3ed8-c12e27c8a81c"
        }
    }
}

What (with the help of the Graph support team) have narrowed it down to is that if I create a token via. Postman, Graph Explore, or elsewhere, I get a property like this

```JSON
"wids": [
      "62e90394-69f5-4237-9190-012177145e10",
      "b79fbf4d-3ef9-4689-8143-76b194e85509"
],

where as the SPFx token only has a "haswids": "true",

Steps to reproduce

Create SPFx solution, grant the PeopleSettings.ReadWrite.All graph permissions, and follow the docs to get a GraphClientV3

https://learn.microsoft.com/en-us/sharepoint/dev/spfx/use-aad-tutorial#using-msgraphclientv3

Try the request from above, and watch it fail, retry in Graph Explorer to validate your user does indeed have the required permissions.

Expected behavior

The token should grant the same permissions as the Graph Explorer (not same scopes, but same roles)


NOTE This is a reopen of an old issue that has more info #9368 - but is still present

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.