SharePoint / SharePoint/sp-dev-docs

Graph token generated from SPFx app returns empty response from /usageRights endpoint

Open
#10,345 7 comments 0 reactions 1 assignee View on GitHub

@Ashlesha-MSFT is already working on this.

Since Jul 25, 2025.

Needs: Author Feedback 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
  • browser version
  • SPFx version 1.21.1
  • Node.js version 18.18.0
  • etc
Describe the bug / error

When using a Graph token generated from an SPFx app, the beta/me/usageRights endpoint returns an empty array with a 200 OK response. When using Graph Explorer, all licenses are returned.

I understand this may not be an SPFx issue. If this is a Graph API issue, how can I get this information over to them? This is stopping us from enforcing licenses on the SPFx side and is a major blocker. Thanks!

Graph explorer response:

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#users('05c1fcca-11a6-444d-84f0-efd435dba6b0')/usageRights",
    "@odata.nextLink": "https://graph.microsoft.com/beta/users/05c1fcca-11a6-444d-84f0-efd435dba6b0/usageRights?$skiptoken=***",
    "@microsoft.graph.tips": "Use $select to choose only the properties your app needs, as this can lead to performance improvements. For example: GET users('<guid>')/usageRights?$select=catalogId,serviceIdentifier",
    "value": [
        {
            "id": "***",
            "catalogId": "***",
            "serviceIdentifier": "***",
            "state": "inactive"
        }
    ]
}

Response from SPFx app:

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#users('05c1fcca-11a6-444d-84f0-efd435dba6b0')/usageRights",
    "value": []
}
Steps to reproduce
  1. Log in as a user with an assigned license
  2. Generate a Graph token from the SPFx app with User.Read permissions
  3. Call https://graph.microsoft.com/beta/me/usageRights
Expected behavior

Endpoint returns a list of assigned licenses.

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.