Authenticate and Download OneDrive Files with Microsoft Graph REST
Question details
The user needs to authenticate a REST request and download a OneDrive file using the correct access token.

- Product
- Microsoft OneDrive REST API and Microsoft Graph
- Device & OS
- not provided
- Scenario
- An application requests a OneDrive file through a REST API.
- Observed behavior
- The API returns an invalid issuer or signature error, which can indicate that the access token was issued for a different service or endpoint.
Identify the exact API endpoint, account type, and authentication flow your application uses. Have access to the application's Microsoft Entra registration and the file or drive item ID.
Request a Microsoft Graph token and download the file
Use this approach when downloading a OneDrive file through Microsoft Graph.
Confirm that the request targets https://graph.microsoft.com. A token issued for a different service, such as a legacy Office 365 REST endpoint, cannot be assumed to work with Microsoft Graph.
In the Microsoft Entra admin center, open Identity > Applications > App registrations, select your app, and choose API permissions > Add a permission > Microsoft Graph. For a signed-in user's own files, add the delegated Files.Read permission and grant consent as required.
Use the authorization code flow and request the Files.Read scope through the Microsoft identity platform. Send the resulting access token, not the ID token, in the Authorization: Bearer header.
Send GET https://graph.microsoft.com/v1.0/me/drive/items/{item-id}/content with the bearer token, replacing {item-id} with the file's item ID. Follow the returned download redirect to retrieve the file.
Inspect the access token's audience and issuer using a token inspection tool. Confirm that the audience is for Microsoft Graph, the token is not expired, and the signing authority and account type match the endpoint and tenant used by the app.

Match the token to a legacy OneDrive or Office 365 REST endpoint
Use this approach if the application must continue calling an older REST endpoint rather than Microsoft Graph.
Work with Office files in WPS Office
WPS Office is a free, lightweight Office alternative with a familiar interface for working with Microsoft Office files. It can help you continue editing compatible downloaded files, though it does not fix OneDrive REST authentication errors.

Frequently Asked Questions
Why does my OneDrive request report an invalid issuer or signature?
The access token may have been issued for a different API or by an authority the endpoint does not accept. Check the token's audience, issuer, expiration, and signing authority against the endpoint's authentication requirements.
Can I use an ID token to download a OneDrive file?
No. Obtain an access token for the API and send it in the Authorization: Bearer header. An ID token identifies the signed-in user to the application and is not a substitute for an API access token.
Which permission lets a signed-in user read their OneDrive files?
For Microsoft Graph delegated access, Files.Read allows an app to read the signed-in user's files. Add it under App registrations > API permissions and obtain the required consent.
Can I use the /me endpoint without a signed-in user?
No. The /me endpoint requires delegated access with a signed-in user. For app-only access, use an appropriate user or drive-specific endpoint and configure an application permission with administrator consent.




