OneDrive File Issues

Authenticate and Download OneDrive Files with Microsoft Graph REST

Kushani NimanthikaKushani Nimanthika Nov 22, 2026 868 views

Question details

The user needs to authenticate a REST request and download a OneDrive file using the correct access token.

Authenticate and Download OneDrive Files with Microsoft Graph REST
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.
Before you start

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.

Solution 1Recommended

Request a Microsoft Graph token and download the file

Use this approach when downloading a OneDrive file through Microsoft Graph.

1
Check the API endpoint

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.

2
Configure permissions

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.

3
Obtain a Graph access token

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.

4
Download the file

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.

5
Check the token if authentication fails

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.

Request a Microsoft Graph token and download the file
App-only access: For an app without a signed-in user, configure an appropriate Microsoft Graph application permission, such as Files.Read.All, grant administrator consent, and request the https://graph.microsoft.com/.default scope using the client credentials flow. Use a user or drive-specific endpoint instead of /me.
Free Microsoft Office alternative

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.

Open and edit compatible files downloaded from OneDriveSupports Microsoft Office formats, including DOCX, XLSX, and PPTXFamiliar interface helps make the switch from Microsoft Office easierFree, lightweight suite for everyday document work
QA img-9

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.