Fix Embedded SharePoint File Requiring Sign-In with Public Link
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.

- 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).
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.
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.
Open your file in SharePoint or Excel for the web, click the 'Share' button, and select the 'Anyone with the link can view' option.
Click 'Apply' and copy the newly generated public sharing link to your clipboard.
Replace the existing 'src' attribute inside your HTML iframe tag with the new public link.

Test for Iframe Security Restrictions
Check if SharePoint or browser security policies are actively blocking the iframe from rendering the file.
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. Download WPS Office: Install WPS Office for free from the official website on your preferred device.
- 2. Open your Office files: Open your existing .xlsx or .docx files directly in WPS Office without worrying about format conversion.
- 3. Share securely: Use the built-in sharing tools to quickly generate public or password-protected links for easy collaboration.

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.




