Why does the SharePoint Online Role not appear in my Azure AD SP Token?

Mark Heidl 21 Reputation points
2023-07-08T20:56:19.02+00:00

Hi,

i want to use an Azure AD SP to access my SharePoint Sites and Lists.

I added the Sites.FullControl.All role but when i receive my token, i dont see any roles at all.

User's image

When i add Application Roles for Microsoft Graph, those roles are displayed in the token.

How do i access my SP with SharePoint Roles, so that i can use Microsoft Graph ?

Best regards,

Mark

Microsoft 365 and Office | SharePoint | Development
Microsoft Security | Microsoft Entra | Microsoft Entra ID
Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

Accepted answer
  1. Vasil Michev 119.7K Reputation points MVP Volunteer Moderator
    2023-07-09T14:08:16.4+00:00

    Those are different resources (note the value of the "aud" claim in the token you've obtained). If you want to obtain a token that includes the permissions you've granted for the SPO resource, make sure to add the corresponding scope in your token request.

    Do note that the Sites.FullControl.All scope is also available for the standard Microsoft Graph resource, so you might as well add it therein (depending on your use case that is).

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

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