I'm trying to access my OneDrive (personal account) files using the Microsoft Graph API but I can't get it to work. I have read for days now whithout luck. I'm using the "Client Credentials Flow". I have created an application in the Application Registration Portal and I have set application permissions. It works fine to get a token but when I try to read the root of OneDrive using this token it says "Access Denied", "Either scp or roles claim need to be present in the token.". This happens when I use the v2.0 version to get the token and then the v1.0 version to access OneDrive. I.e. I use this URL to get the token: https://login.microsoftonline.com/common/oauth2/v2.0/token and this URL to get the OneDrive root: https://graph.microsoft.com/v1.0/drive/root?$expand=thumbnails,children($expand=thumbnails)
It works fine when I do the "Authorization Code Flow".
What can be the problem?