0
votes

I have built a asp.net app that successfully accesses o365 exchange with an App Only Token and Graph. I am now trying to access a specific user's OneDrive for Business files with the same token and a Get request similar to the following:

https://mycomp-my.sharepoint.com/_api/v2.0/drives/[email protected]/items

but I get the following error:

3001000;reason='There has been an error authenticating the request.';category='invalid_client'

Any idea what is the cause of the error?

2
How did you create the token? Did you use the client secret or a certificate?Brad
I created the token using a certificate. Using the same token creation code I managed to access O365 exchange successfullySimon Shaw

2 Answers

0
votes

It's possible to do app-delegated access to OneDrive for Business today using the direct API endpoint and the Sites.ReadWrite.All app-delegated permission scope in AAD. I'd consider it more "in preview" than supported, so Yina's answer is technically correct. I'm still getting the documentation for how build an app finalized, but we'll be publishing something soon.

Andrew Connell has a good blog post about how to get this setup, available here: http://www.andrewconnell.com/blog/user-app-app-only-permissions-client-credentials-grant-flow-in-azure-ad-office-365-apis

Use of the OneDrive API is possible using this same method.

0
votes

App Only access to a user's OneDrive is not supported via Microsoft Graph at this point in time.