Invalid Authentication Token when using Microsoft OneDrive REST API

marcelganczak

New member
Aug 19, 2019
1
0
0
I'm trying to integrate my app with OneDrive. I'm following this tutorial:
docs.microsoft.com/en-us/onedrive/developer/rest-api/getting-started/?view=odsp-graph-online For oauth I'm using Azure AD v2.0 endpoint.

To get the access token, I'm calling login.microsoftonline.com/common/oauth2/v2.0/token and it successfully answers with some json:

{ token_type: 'Bearer',
scope: 'onedrive.readwrite',
expires_in: 3600,
ext_expires_in: 3600,
access_token: '...',
refresh_token: '...' }

When using the access_token that I received to call graph.microsoft.com/v2.0/me/drive/root/delta, I get this response:

{
"error": {
"code": "InvalidAuthenticationToken",
"message": "CompactToken parsing failed with error code: 8004920A",
"innerError": {
"request-id": "5eda75b0-c2d5-467f-a728-8006490c00b2",
"date": "2019-08-19T15:56:10"
}
}
}

This error is pretty cryptic and for the life of me I can't work out why that token won't work with this endpoint. Can someone help?
 

Members online

No members online now.

Forum statistics

Threads
339,709
Messages
2,262,742
Members
428,764
Latest member
CyberID10T