1
votes

I'm attempting to take advantage of the public preview of Microsoft Graph reporting APIs for retrieving Office 365 product usage data. I have an application registered for Graph that successfully executes Graph calls for non-reporting APIs (i.e. the access_token I generate with my app is successfully used to access users information for a tenant: https://graph.microsoft.com/beta/users) but when I try any of the report resources I encounter the below error:

Invalid scope claims/roles.

According to the documentation I've read this would seem to imply that my app does not have the necessary permissions for reports but this is not correct as I have confirmed that the app has the "Read all usage reports" application permission enabled.

Has anyone else encountered similar challenges with the Microsoft Graph reporting APIs and have any suggestions that I could try?

1

1 Answers

0
votes

If you added this scope after you had already authorized the application, it may still be using the previous/cached list of scopes. You can force re-authorization by adding ?prompt=consent to your initial authorization URL. For example:

https://login.microsoftonline.com/common/oauth2/authorize?client_id={app id} &response_type=code&redirect_uri={redirect uri}&prompt=consent