logo
search
Permission & Access Issues

How to Embed a OneDrive File on a Website Without Requiring Sign-In

Khadija KhanKhadija Khan Sep 25, 2026 870 views

Question details

The user wants to embed a file from OneDrive onto a public website so that visitors can view the content without having to log into a Microsoft account.

How to Embed a OneDrive File Without Requiring Sign-In
Product
OneDrive
Device & OS
not provided
Scenario
Embedding a document or media file onto a public website for unauthenticated visitor access.
Observed behavior
Embedded OneDrive files are prompting website visitors to authenticate and sign in, preventing seamless public viewing of the content.
Before you start

Ensure you have owner permissions for the OneDrive file you intend to embed, and verify whether your organization's Microsoft 365 administrator allows anonymous external sharing.

Solution 1Recommended

Enable 'Anyone with the link' sharing permissions

Adjusting the file's sharing settings to allow anonymous access before generating the embed code can bypass the sign-in prompt, provided tenant settings allow it.

By default, OneDrive files are often restricted to authenticated users within your organization. To embed a file publicly, you must generate an anonymous sharing link first.

1
Access the file in OneDrive

Open your web browser, navigate to the OneDrive website, log in with your Microsoft credentials, and locate the file you want to embed.

2
Change sharing settings

Right-click the file and select 'Share'. Click on the permission settings (usually defaults to 'People in your organization') and change it to 'Anyone with the link'.

3
Generate the embed code

Once the anonymous link is created, close the sharing dialog. Right-click the file again, select 'Embed', and click 'Generate'. Copy the provided HTML iframe code and paste it into your website's source code.

Enable 'Anyone with the link' sharing permissions
Tenant Restrictions: If the 'Anyone with the link' option is grayed out or unavailable, your Microsoft 365 IT administrator has disabled anonymous sharing for your organization.
Free Microsoft Office alternative

Share and View Documents Seamlessly with WPS Office

If Microsoft 365 tenant restrictions are making it difficult to share files publicly without sign-in prompts, WPS Office provides a highly compatible and lightweight alternative. You can create, edit, and easily share documents with anyone, bypassing complex enterprise permission barriers while maintaining perfect formatting.

  1. 1. Download WPS Office: Install the free WPS Office suite on your Windows, Mac, or Linux computer.
  2. 2. Open or create your document: Launch the application and open your existing Microsoft Office files or create a new document from scratch.
  3. 3. Share without hassle: Use the built-in 'Share' feature to generate a quick, accessible link for your colleagues or audience.
Generate public sharing links easily without forcing recipients to sign inFully compatible with Microsoft Word, Excel, and PowerPoint file formatsLightweight, fast, and completely free to download and useFamiliar user interface for a smooth transition from Microsoft Office
microsoft office alternative - wps office

Frequently Asked Questions

Why is the 'Anyone with the link' option grayed out in OneDrive?

This option is disabled when your organization's Microsoft 365 IT administrator has turned off anonymous external sharing at the tenant level to enforce data security policies.

Can I embed a SharePoint document without requiring a login?

Just like OneDrive, SharePoint requires authentication for embedded files unless anonymous guest access is explicitly enabled in the SharePoint admin center.

If I update the original file in OneDrive, will the embedded version on my website update automatically?

Yes, as long as the file is successfully embedded directly from OneDrive, any edits saved to the original document will automatically reflect on your website upon refreshing the page.