Hi ,
Could you please follow docs - reportroot-authorization , let me know if that helps.
S2SUnauthorized error while retrieving Microsoft 365 usage reports via MS Graph API
I have been trying to get usage reports via Graph API using MSGraphClient in SPFx. I have added Reports.Read.All permissions in my package-solution.config file. I am getting the error "S2SUnauthorized-Invalid permissions".
I have also granted limited administrative role to the user for accessing the reports data. I have granted admin consent by going to the Azure AD application
As per this article https://learn.microsoft.com/en-us/sharepoint/dev/spfx/use-msgraph this is a known issue.
Can anyone please suggest an alternate way of exporting usage reports data programmatically?
Microsoft Security Microsoft Graph
3 answers
Sort by: Most helpful
-
Vicky Kumar (Mindtree Consulting PVT LTD) 1,161 Reputation points Microsoft Employee
2022-02-25T11:27:45.493+00:00 -
CarlZhao-MSFT 46,371 Reputation points
2022-02-28T02:55:38.27+00:00 You should not remove permissions, the permissions in Other permissions granted for Nagarro are all removed permissions, it will not appear in your token, you should add them to Configured permissions.
Since the use of the implicit flow is in the browser, its length may be truncated, so the official does not recommend that you use the implicit flow to connect to the graph. I suggest you use auth code flow or client credential flow, they both work.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread. -
Aravind G 1 Reputation point
2022-08-29T17:01:53.55+00:00 Even am having the same issue.Also i have provided sharepoint administrator role to the user as it is required to provide limited administrator role in azure AD as per doc.
https://learn.microsoft.com/en-us/graph/reportroot-authorization
Could someone help on this please?