Supported way for a browser to download a SharePoint or OneDrive file directly from Microsoft after pre-authenticated URLs are removed (April 1, 2027)

Joshua Grippo 0 Reputation points
2026-12-03T00:06:52.4566667+00:00

We run a web application that stores customer documents in each customer's SharePoint document library. Downloads start in the user's browser. For bandwidth reasons, we do not want file bytes to pass through our servers. The browser should download directly from Microsoft.

Our server authenticates to Microsoft Graph as an application, using client credentials with a certificate. The app has the Sites.ReadWrite.All and Files.ReadWrite.All application roles.

Today the flow is:

  1. Our server calls GET /drives/{driveId}/items/{itemId}/content.
    1. Graph returns a 302 to a pre-authenticated URL on {tenant}.sharepoint.com.
      1. The browser follows that URL with no Authorization header and receives the file.
    2. Microsoft has announced: "On April 1, 2027, SharePoint Online and OneDrive will begin removing pre-authenticated URLs," and "download a file" is listed as affected.
  2. What we need to understand:
  3. After that date, what is the supported way for a browser to download a file straight from SharePoint or OneDrive, without the bytes passing through our server?
    1. Can our server obtain a short-lived link for one file that the browser can use with no Authorization header, so we never hand the browser a Graph token? Is a sharing link (for example, createLink with a specific scope and expiry) the intended replacement? What are its limits and permission requirements?
      1. If the browser must authenticate to Microsoft itself, what is the supported pattern? We understand a JavaScript request with an Authorization header to /content fails the CORS preflight. Is there a supported endpoint or header option that works from a browser?
        1. Is it supported for our server to hand the browser a limited-scope token, for example one tied to a single file? The app-only token we hold is not limited to one file, so we do not want to give it out.
          1. Will GET /drives/{driveId}/items/{itemId}/content continue to return a 302 after that date? If so, to what kind of URL?
            1. Are there throttling or egress limits we should plan for when many users download at once across many tenants?
Microsoft 365 and Office | SharePoint | Development
0 comments No comments

2 answers

Sort by: Most helpful
  1. Dora-T 2,425 Reputation points Independent Advisor
    2026-12-03T02:40:09.8566667+00:00

    Hi Joshua Grippo

    Thank you for providing such a detailed explanation of your current architecture and the requirements for your download workflow. I'd like to address your questions individually and share a few additional points that may help you evaluate your migration options.

    1.Is there a supported way for the browser to download files directly from SharePoint or OneDrive without passing the file content through your server after April 1, 2027?

    Based on the currently available Microsoft documentation, I could not find a supported replacement that allows an unauthenticated browser to download file content directly in the same manner as the retiring pre-authenticated URL mechanism.

    Microsoft's migration guidance also mentions driveItem/contentStream as an API that already returns content directly without relying on pre-authenticated URLs or redirects. However, you should verify its current support and availability status before adopting it in production.

    2.Can the server generate a short-lived, per-file URL that the browser can use without an Authorization header? Is createLink the intended replacement?

    I could not find documentation confirming that an app-only access token can be exchanged for a short-lived, per-file download URL that the browser can access anonymously.

    Regarding createLink, this API creates a sharing link rather than a replacement specifically designed for the retiring pre-authenticated download URLs.

    The availability and behavior of the generated link depend on the link type, the application's permissions, and the sharing policies configured by each customer tenant. For example, anonymous sharing links are subject to the tenant's external sharing settings and applicable link expiration policies.

    Therefore, although createLink may be worth evaluating for scenarios where sharing links are suitable, I would not assume that it provides the same behavior as the existing pre-authenticated download URL mechanism.

    3.If browser authentication is required, what supported approach is available, particularly regarding CORS?

    Obtaining a delegated access token with MSAL.js does not, by itself, guarantee that a browser can download file content directly.

    For URLs returned in response bodies, Microsoft states that they will no longer carry tempauth. Accessing these URLs requires a valid Microsoft Entra ID access token in the Authorization header. The token audience must match the URL being accessed, whether it belongs to Microsoft Graph or SharePoint Online.

    One related option worth considering is the Microsoft Graph URL opt-in setting. SharePoint administrators can configure UseGraphUrl so that specific third-party applications receive Microsoft Graph URLs instead of SharePoint URLs for supported API scenarios.

    For example:

    Set-SPOTenantPreAuthSettings -UseGraphUrlIsEnabled $true -UseGraphUrlAppsList "<app-id>"
    

    This allows your application to use its existing Microsoft Graph access token when accessing supported Graph URLs. However, it does not apply to every API. For scenarios without a Graph URL alternative, a SharePoint Online access token is still required.

    This is a tenant-level setting, so the administrator of each customer tenant would need to enable it. Also, this setting does not eliminate authentication requirements or provide an anonymous download link for the browser.

    Regarding your CORS issue, I could not find documentation confirming a CORS-supported pattern for browser requests using the new direct-content response. I therefore recommend testing the browser authentication and CORS behavior in a development tenant before relying on this approach in your production architecture.

    4.Can the server provide the browser with a limited-scope token for a single file instead of exposing a broadly privileged app-only token?

    Regarding your concern about exposing a broadly privileged token, Microsoft Graph supports Files.SelectedOperations.Selected, which allows an application to access explicitly assigned files or folders rather than having unrestricted access to all files.

    This requires admin consent, an explicit permission assignment on the target resource, and an access token containing the appropriate Selected permission.

    This is a resource-level permission model supported in both application and delegated modes. However, it is not a mechanism for generating a temporary single-file browser download token.

    Also, assigning permissions at the file or folder level breaks permission inheritance, which should be considered when designing your solution.

    Since your application currently has Files.ReadWrite.All and Sites.ReadWrite.All, simply adding Files.SelectedOperations.Selected would not restrict the application's existing broad access. If your goal is to limit access to explicitly assigned files, you would also need to review and remove any broader permissions that are no longer required, then configure the appropriate resource-level permission assignments.

    Reference: Overview of Selected Permissions in OneDrive and SharePoint - Microsoft Graph | Microsoft Learn

    5.Will GET /drives/{driveId}/items/{itemId}/content still return a 302 redirect after April 1, 2027? If so, where will it redirect?

    According to Microsoft's announcement and the Set-SPOTenantPreAuthSettings (Microsoft.Online.SharePoint.PowerShell) | Microsoft Learn, this endpoint will no longer return an HTTP 302 redirect to a pre-authenticated download URL. Instead, the file content will be returned directly in the response to the original authenticated Microsoft Graph request.

    This behavior will begin rolling out on April 1, 2027, as part of the retirement of pre-authenticated URLs.

    6.What throttling or egress limits should be considered for concurrent downloads across multiple tenants?

    For your multi-tenant application, Microsoft's current SharePoint Online documentation lists the following default limits:

    -Downloading a drive item: 1 resource unit per request.

    -Application egress: 400 GB per hour per application per tenant.

    -Specific sharing APIs: 300 requests per five minutes per application per tenant.

    -Anonymous download egress: 100 GB per two hours per site.

    For multitenant applications, resource consumption is measured separately for each application-tenant pair, so reaching a limit in one tenant does not directly affect the application's usage limits in other tenants.

    Resource unit limits also apply per application per tenant, per minute and per 24 hours, and scale with the tenant's license count. Since each download consumes 1 resource unit, these limits affect the rate at which your application can process download requests.

    The 100 GB per two hours anonymous egress limit applies specifically to anonymous downloads, such as downloads through anonymous sharing links, and should not be confused with the 400 GB per hour application egress limit.

    Microsoft recommends reducing concurrent requests, avoiding request spikes, and honoring the Retry-After header when receiving HTTP 429 or 503 responses.

    Reference: Avoid getting throttled or blocked in SharePoint Online | Microsoft Learn

    Please understand that this is a user-to-user community forum. As an Independent Advisor, I cannot access Microsoft's internal systems or product engineering resources, so I can only share information based on publicly available documentation.

    Because you are looking for confirmation of the supported browser-based download approach after the retirement of pre-authenticated URLs, particularly regarding the /content API behavior, authentication requirements, and CORS support, I would recommend raising a Microsoft Unified Support ticket. This would allow your questions to be reviewed by the appropriate SharePoint Online or Microsoft Graph product specialists. 

    Please note that this is a paid support channel, which requires an active support plan or an eligible support agreement. However, the benefit of using this channel is that your inquiry can be handled through Microsoft's technical support process and, where appropriate, reviewed by the relevant product engineering team. They are better positioned to provide authoritative clarification on complex implementation scenarios that may not yet be fully covered by publicly available documentation. 

    You can refer to this guide Open a new Support request - Microsoft Engage Center | Microsoft Learn 

    Was this answer helpful?

    1 person found this answer helpful.

  2. AI answer

    2026-12-03T00:08:42.5533333+00:00

    After April 1, 2027, GET /drives/{driveId}/items/{itemId}/content will return the file bytes directly to the authenticated caller instead of issuing a 302 to an unauthenticated URL, so the current server-call-plus-browser-redirect architecture will no longer work. ^1^

    Confirmed post-retirement behavior

    For the drive-item /content operation:

    • The request still requires a valid Microsoft Graph access token.
    • Graph returns the content in that authenticated response.
    • Applications must stop depending on a 302, inspecting Location, or forwarding that URL to an unauthenticated client.
    • @microsoft.graph.downloadUrl will no longer be an anonymous per-file capability URL. Depending on tenant configuration and API support, URL-valued properties may contain an authenticated Graph URL or a plain SharePoint URL requiring an Entra token. ^2^

    Consequently, there is no documented replacement that lets the server exchange its app-only token for a short-lived, single-file URL that any browser can redeem without authentication.

    If customer policy permits sharing, the server can create a view sharing link and send its web URL to the browser:

    POST /v1.0/drives/{driveId}/items/{itemId}/createLink
    Authorization: Bearer {server-app-token}
    Content-Type: application/json
    
    {
      "type": "view",
      "scope": "anonymous",
      "expirationDateTime": "{near-future UTC timestamp}"
    }
    

    Your existing Files.ReadWrite.All application permission satisfies the documented least-privileged application permission for createLink; Sites.ReadWrite.All is also accepted as a higher privilege. ^3^

    Important differences from the retiring download URL:

    • It is a sharing web link, not a documented raw-byte or attachment-style download endpoint. It may open Microsoft’s file-viewing experience, from which downloading can be available.
    • An anonymous link grants access to anyone possessing it and can be disabled by the tenant administrator.
    • createLink can return an existing link of the same type for that application rather than minting a unique capability for every download.
    • The permission remains visible on the item and can be removed by an owner.
    • Links do not automatically expire unless an expiration is supplied or tenant policy enforces one.
    • Administrators can require expiration and cap the maximum lifetime of “Anyone” links. ^4^

    Therefore, use createLink only if a persistent sharing permission and SharePoint/OneDrive browser experience meet the requirement. It is not documented as a direct replacement for tempauth downloads.

    Browser-authenticated download

    A browser SPA can use MSAL.js to obtain a delegated Graph token for its signed-in user; browser applications are public clients and cannot safely hold certificates, secrets, or app-only credentials. ^5^

    That solves token acquisition, but the available documentation does not establish a CORS-supported browser request pattern for receiving the future direct /content response. The currently documented JavaScript workaround—fetching @microsoft.graph.downloadUrl without an authorization header—depends specifically on the preauthenticated URL being retired. ^6^

    Until Microsoft documents and supports the necessary CORS behavior, do not treat delegated authentication alone as a complete direct-browser-download solution. Validate the post-retirement behavior in a test tenant before adopting it.

    Do not expose the app-only token

    Do not send the certificate-acquired application token to the browser. It carries the application roles granted to the app and is not converted into a single-file token.

    Files.SelectedOperations.Selected can restrict an application to explicitly assigned files, but this is a durable application/resource permission model: it requires Entra consent, an explicit assignment on the resource, and a token containing that Selected permission. Assigning file-level permissions also breaks inheritance. It is not an ephemeral browser download token. ^7^

    Practical architecture choices

    1. Sharing is acceptable: create a read-only sharing link, enforce a short expiration, and send the browser to Microsoft’s sharing experience.
    2. The user can authenticate and Microsoft confirms CORS support: use MSAL.js and delegated permissions, then let the browser call the supported authenticated content endpoint.
    3. Neither condition applies: the established fallback is for your backend to call /content and stream/proxy the response. This does put bytes through your infrastructure; no equivalent anonymous per-download URL is currently documented.

    The UseGraphUrl tenant setting is useful for administrator-controlled compatibility testing, but it does not create anonymous URLs or solve browser token/CORS constraints. A SharePoint administrator can target a third-party app with Set-SPOTenantPreAuthSettings -UseGraphUrlIsEnabled $true -UseGraphUrlAppsList "<app-id>"; test this outside production first. ^2^

    Capacity planning

    Current default SharePoint limits include:

    • Downloading a drive item: 1 resource unit.
    • Specific sharing APIs: 300 requests per five minutes per app per tenant.
    • Application egress: 400 GB per hour per app per tenant.
    • Anonymous download egress: 100 GB per site per two hours.
    • Multitenant application usage is isolated per tenant/application pair.

    These defaults can change. Handle 429 and 503 by honoring Retry-After, monitor RateLimit headers, reduce concurrency, and avoid bursts. ^8^


    References

    1. Pre-authenticated (tempauth) URLs are retiring: move to Microsoft Entra ID tokens before April 1, 2027 - Microsoft 365 Developer Blog
    2. Set-SPOTenantPreAuthSettings (Microsoft.Online.SharePoint.PowerShell) | Microsoft Learn
    3. Create a sharing link for a DriveItem
    4. Manage sharing settings for SharePoint and OneDrive in Microsoft 365
    5. Public client and confidential client applications
    6. Download driveItem content
    7. Overview of Selected permissions in OneDrive and SharePoint
    8. Avoid getting throttled or blocked in SharePoint Online
    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

    1 person found 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.