Search code examples
phpmicrosoft-graph-apionedrive

Microsoft Graph API: Omit user access token


I'd like to run some periodic checks from a web server (checking for new files in a OneDrive directory), this means there is no logged in user, is it possible to access Graph endpoints with just the permissions that the application has?

I.e. using the Application Id and Password/Public Key.


Solution

  • In endpoint documentation you can find which permission is required as in the example below:

    enter image description here

    Make sure you obtain access token without a user to have it working.

    You can also check your token using jwt.io and make sure it's payload contains appropriate role.