Permission & Access Issues

Fix Embedded SharePoint File Requiring Sign-In with Public Link

Kushani NimanthikaKushani Nimanthika Oct 20, 2026 868 views

Question details

The user is attempting to embed a SharePoint or Excel for the web file into a webpage using an iframe, but the embedded viewer prompts for user authentication despite being generated from a public link.

How to Fix an Embedded SharePoint File That Requires Sign-In
Product
Microsoft SharePoint and Excel for the web
Device & OS
not provided
Scenario
Embedding a publicly shared document into an external webpage or site using an HTML iframe.
Observed behavior
The iframe displays a sign-in prompt instead of the document, even though the original sharing link was set to public (Anyone with the link).
Before you start

Verify that your organization's SharePoint administrator settings allow the creation of anonymous 'Anyone with the link' sharing URLs, as strict tenant policies can override individual file permissions.

Solution 1Recommended

Use an Anonymous Sharing Link Instead of the Embed URL

Prevent authentication prompts by ensuring the iframe source URL is a true anonymous access link rather than a default backend URL.

Default embed URLs or internal Doc.aspx links generated by SharePoint and Excel for the web often require user identification to locate the file, regardless of file-level permissions.

1
Generate a new public link

Open your file in SharePoint or Excel for the web, click the 'Share' button, and select the 'Anyone with the link can view' option.

2
Copy the sharing URL

Click 'Apply' and copy the newly generated public sharing link to your clipboard.

3
Update your iframe code

Replace the existing 'src' attribute inside your HTML iframe tag with the new public link.

Use an Anonymous Sharing Link Instead of the Embed URL
Browser Session Caching: If you open the public link directly in a new tab first, your browser creates a cached authenticated session. This can falsely make the iframe appear to work without sign-in during testing in the same window.
Free Microsoft Office alternative

Share and Collaborate Seamlessly with WPS Office

Avoid complex SharePoint embedding restrictions and confusing sign-in loops. WPS Office provides a free, lightweight, and highly compatible alternative to Microsoft Office, offering simple file sharing and easy collaboration without the hassle of iframe security blocks.

  1. 1. Download WPS Office: Install WPS Office for free from the official website on your preferred device.
  2. 2. Open your Office files: Open your existing .xlsx or .docx files directly in WPS Office without worrying about format conversion.
  3. 3. Share securely: Use the built-in sharing tools to quickly generate public or password-protected links for easy collaboration.
Fully compatible with Microsoft Excel (.xlsx), Word (.docx), and PowerPoint (.pptx) formats.Generate hassle-free public sharing links for your documents with a single click.Bypass complex SharePoint authentication and iframe embedding restrictions.Lightweight installation with a familiar, easy-to-use interface.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my embedded Excel web file work in normal browsing but ask for sign-in in incognito mode?

In normal browsing mode, you are likely already logged into your Microsoft account, or you previously clicked the public link, which created a temporary authenticated session. Incognito mode lacks this session data, revealing the true authentication requirement of the embed link.

Can I embed a full SharePoint site page anonymously?

Generally, embedding an entire SharePoint site page for anonymous (unauthenticated) users is highly restricted or unsupported in Microsoft 365. 'Anyone' sharing links are typically designed for individual files or documents, not entire site pages.

What does the Doc.aspx URL do in a SharePoint iframe?

The Doc.aspx URL is an internal routing link used by SharePoint to locate a file's identifier. It is not designed for public sharing and inherently requires an active Microsoft 365 sign-in session to resolve the file correctly, causing sign-in prompts when used in an iframe.