logo
search
File Sharing Problems

How to Publicly Embed OneDrive PDF Files Without Sign-In

Bushra ParveenBushra Parveen Sep 27, 2026 869 views

Question details

Users need to embed a PDF file stored in a business OneDrive or SharePoint account into a public web page using an iframe, ensuring visitors can view the document without being prompted to sign in.

How to Publicly Embed OneDrive PDF Files Without Requiring Sign-In
Product
Microsoft OneDrive / SharePoint
Device & OS
not provided
Scenario
Embedding a business PDF document into a public-facing website via an iframe.
Observed behavior
The embedded PDF file refuses to load in a public iframe because Microsoft blocks anonymous iframe embedding or enforces authentication for business accounts.
Before you start

Ensure you have the necessary permissions to share files publicly from your organization's OneDrive or SharePoint account, as external anonymous sharing is often restricted by IT administrators.

Solution 1Recommended

Configure 'Anyone with the link' Permissions and Generate Embed Code

Use this solution to adjust file sharing permissions to allow anonymous access before generating the official OneDrive embed code.

For a file to be visible to the public without requiring a login, its sharing permissions must be explicitly set to allow anonymous access. This method relies on your organization allowing external sharing.

1
Access File Sharing Settings

Open OneDrive or SharePoint in your web browser, locate your PDF file, and click the 'Share' icon next to the file name.

2
Set Permissions to Anyone

Click the current permission setting (e.g., 'People in your organization') to open the Link settings. Select 'Anyone with the link' and click 'Apply'.

3
Generate the Embed Code

Select the file, click the three-dot menu (More options), and choose 'Embed'. A panel will appear on the right side. Copy the provided iframe code.

4
Test the Embedded File

Paste the iframe code into your website's HTML. Open your webpage in a private or incognito browsing window to verify that the PDF loads without a sign-in prompt.

Configure 'Anyone with the link' Permissions and Generate Embed Code
External Sharing Disabled: If the 'Anyone with the link' option is greyed out or missing, your organization's IT administrator has disabled external anonymous sharing. You will need to use an alternative hosting method.
Free Microsoft Office alternative

Create and Manage PDFs Unrestrictedly with WPS Office

Bypass complicated Microsoft cloud sharing permissions by managing your PDFs locally. WPS Office is a free, lightweight alternative to Microsoft Office that allows you to effortlessly create, edit, and export PDFs, ensuring they are ready for any public web hosting platform without unexpected sign-in blocks.

  1. 1. Open Your Document: Launch WPS Office and open your source document or existing PDF.
  2. 2. Edit and Finalize: Use the comprehensive built-in tools to modify text, adjust layouts, or add annotations as needed.
  3. 3. Export Locally: Click on 'Menu' and select 'Export to PDF' to save a clean, restriction-free local copy ready to be uploaded to your public web server.
Fully compatible with Microsoft Office formats (Word, Excel, PowerPoint)Built-in advanced PDF toolkit for easy editing and formattingSave files locally to bypass restrictive cloud sharing policiesLightweight application with a familiar, user-friendly interface
microsoft office alternative - wps office

Frequently Asked Questions

Why does my embedded OneDrive PDF show a sign-in error on my website?

Business OneDrive and SharePoint accounts have strict security policies. They often prevent files from rendering in public iframes to protect against clickjacking, or they require authentication unless external anonymous sharing ('Anyone with the link') is explicitly enabled.

Can I bypass the login by adding 'action=embedview' to the sharing URL?

While appending '&action=embedview' to a standard sharing URL optimizes the layout for web embedding, it does not bypass underlying authentication requirements. If the file is not shared publicly, users will still face a login prompt.

What should I do if 'Anyone with the link' is greyed out in OneDrive?

If this option is unavailable, it means your organization's IT administrator has disabled anonymous external sharing for security reasons. You will either need to request an exception from your IT department or host the PDF on a separate public web server.