Forum Discussion

Ridhijain's avatar
Ridhijain
Copper Contributor
Feb 23, 2022

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://docs.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?

  • Abhishek480's avatar
    Abhishek480
    Copper Contributor
    Hi, even I am encountering same issue error,

    Tried with Security Reader role and Global Administartor role but still same error.

    Could anyone help us here please?

    Thanks,
    Abhishek

Resources