Microsoft Graph /content returns non-preauthenticated SharePoint URL which results in 401

Xu, Fanqing (AZSA) 0 Reputation points
2026-10-06T04:49:54.5066667+00:00

I'm seeing behavior that appears inconsistent with the Microsoft Graph documentation for downloading driveItem content.

Expected behavior

According to the documentation, calling:

GET /drives/{drive-id}/items/{item-id}/content

should return a 302 Found redirect to a preauthenticated download URL, equivalent to @microsoft.graph.downloadUrl, which can be downloaded without additional authentication.

Observed behavior

  1. Retrieve driveItem metadata:

GET /drives/{drive-id}/items/{item-id}

Response contains:

"@microsoft.graph.downloadUrl": "https://<tenant>.sharepoint.com/sites/<site>/_layouts/15/download.aspx?UniqueId=<guid>&Translate=false&ApiVersion=2.0"

  1. Download content:

GET /drives/{drive-id}/items/{item-id}/content

Response:

302 Found
Location:
https://<tenant>.sharepoint.com/sites/<site>/_layouts/15/download.aspx?UniqueId=<guid>&Translate=false&ApiVersion=2.0
  1. Access the returned URL:

401 Unauthorized

The URL from @microsoft.graph.downloadUrl and the Location header are identical, but the URL is not directly downloadable and requires authentication.

Questions

  1. Is this behavior expected?
  2. Has the behavior of @microsoft.graph.downloadUrl or /content recently changed? (The failure starting mid-Sep.)
  3. Does Microsoft Graph still guarantee that @microsoft.graph.downloadUrl is a preauthenticated download URL?
  4. If preauthenticated download URLs are being deprecated, what is the recommended replacement for daemon/background applications downloading files from SharePoint Online?

Additional notes

  • File metadata retrieval succeeds.
  • /content returns 302 successfully.
  • Only the final download URL returns 401.
  • SharePoint tenant administrators confirmed no recent SharePoint configuration changes.
  • We were informed that the historical tempauth mechanism may be deprecated, but it is unclear whether that is related to this behavior.

Any clarification would be appreciated.

Microsoft Security | Microsoft Graph
0 comments No comments

1 answer

Sort by: Most helpful
  1. AI answer

    2026-10-06T04:50:15.0633333+00:00

    Yes. The documented contract still says /content returns 302 Found to a preauthenticated download URL, and that this is the same URL exposed as @microsoft.graph.downloadUrl. The documentation also states that the download URL does not require an Authorization header and is short-lived.

    Supported facts from the documentation:

    1. GET /drives/{drive-id}/items/{item-id}/content returns 302 Found.
    2. The Location header points to a preauthenticated download URL.
    3. That URL is the same value exposed by @microsoft.graph.downloadUrl.
    4. @microsoft.graph.downloadUrl is defined as a URL that can be used to download file content without authentication.
    5. The URL is temporary and should be used immediately because it can expire within minutes; the driveItem resource page also states it is short-lived and cannot be cached.

    For the observed 401 Unauthorized on the final SharePoint URL:

    • That behavior does not match the documented expectation for @microsoft.graph.downloadUrl.
    • The provided material does not state that @microsoft.graph.downloadUrl has been deprecated.
    • The provided material does not state that preauthenticated download URLs have been replaced for daemon or background download scenarios.

    What the available material does show is that Microsoft still documents @microsoft.graph.downloadUrl as the intended mechanism in cases where the redirected /content URL must be consumed directly, including JavaScript/CORS scenarios.

    There is one related limitation in the available material: behavior at the storage backend can vary in some scenarios when using the direct download URL. A Microsoft Q&A answer for range downloads states that direct use of @microsoft.graph.downloadUrl bypasses Graph and interacts directly with the file storage backend, and backend behavior may vary by scenario. That supports treating a 401 at the final URL as a service/backend behavior issue rather than as evidence of a documented contract change.

    Based on the available material, the direct answers are:

    1. Is this behavior expected?
      No, not according to the documented behavior for /content and @microsoft.graph.downloadUrl.
    2. Has the behavior recently changed?
      No documented change is present in the available material.
    3. Does Microsoft Graph still guarantee that @microsoft.graph.downloadUrl is a preauthenticated download URL?
      Yes, that is still how it is documented.
    4. If preauthenticated download URLs are being deprecated, what is the replacement?
      No deprecation or replacement is stated in the available material.

    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.