Microsoft 365 Scope ‘Find Files And Folders’ giving AccessDenied Message: Either scp or roles claim need to be present in the token

Hello forum, I am using Microsoft 365 Scope with authentication type ‘ApplicationIdAndSecret’. I have registered Microsoft Graph Api on Azure and have granted Files.Read, Files.ReadWrite and
Files.ReadWrite.AppFolder permissions, but while executing I am getting following error. Can someone please help me on this? I am new to using Microsoft Graph Api.


Hi @Adham_Garcia1

Check if the file path you are using is correct, if you are building the path for files/folders dynamically use write line to see if path is correct.

Hope this is helpful

@Adham_Garcia1 have you figured it out?

Had this issue and got it sorted by doing the following:
Make sure the App Permissions in azure is from the Application permissions, not the Delegate permissions because we require Unattended access

Application permission set so it works for me:

  • Files.Read.All
  • Files.ReadWrite.All
  • Sites.Manage.All
  • Sites.Read.All
  • Sites.ReadWrite.All