logo
search
Permission & Access Issues

Fix OneDrive Asking for Sign-In When Embedding Files on Websites

Maira MehtabMaira Mehtab Sep 21, 2026 869 views

Question details

Users need to ensure that a OneDrive file embedded on a website or LMS like Moodle is accessible to students or visitors without requiring them to sign in to a Microsoft account.

Product
Microsoft OneDrive
Device & OS
not provided
Scenario
Embedding a OneDrive document into an external webpage, blog, or learning management system for public viewing.
Observed behavior
The embedded file frame displays a Microsoft sign-in prompt instead of the document, blocking users who are not authenticated or part of the organization.
Before you start

Ensure you have owner or editor permissions for the OneDrive file you are trying to embed, and check if your enterprise or school account prohibits anonymous public sharing.

Solution 1Recommended

Change Sharing Permissions to Allow Anonymous Access

Update the file's sharing settings in OneDrive to 'Anyone with the link' and generate a new embed code to bypass the authentication prompt.

If a file is embedded using restricted sharing settings, viewers will be forced to log in. Changing the permission level to allow anonymous access resolves this for general audiences.

1
Open sharing settings

Locate the file in your OneDrive online directory, right-click it, and select 'Share' from the context menu.

2
Modify link settings

Click on the current permission level (e.g., 'People in your organization') and change it to 'Anyone with the link'. Apply the changes.

3
Generate new embed code

Close the share dialog, select the file again, and choose 'Embed' from the top menu to generate and copy a fresh iframe snippet.

4
Update your website

Replace the old embed code on your website or Moodle page with the newly generated iframe code.

5
Verify access

Open a private or incognito browser window, navigate to your webpage, and confirm that the embedded file displays without prompting for a login.

Testing in a Private Window: Always test the embed in an incognito window. This ensures you are viewing the page as a completely anonymous user without any cached Microsoft 365 login credentials.
Free Microsoft Office alternative

Try WPS Office for Seamless Document Sharing

If your organization's Microsoft 365 policies restrict how you share embedded files, consider using WPS Office. It provides a lightweight, highly compatible alternative with its own built-in WPS Cloud, making file sharing and public access straightforward without complex permission hurdles.

  1. 1. Download and install: Get WPS Office for free from the official website and install it on your device.
  2. 2. Upload to WPS Cloud: Open your document in WPS Office and save it directly to your integrated WPS Cloud.
  3. 3. Share easily: Click the 'Share' button in the top right corner to instantly generate a public link that anyone can view without signing in.
Free, lightweight, and easy-to-use interfaceFully compatible with Microsoft Office formats (DOCX, XLSX, PPTX)Flexible, hassle-free link sharing via WPS CloudAccessible across Windows, Mac, Linux, Android, and iOS
microsoft office alternative - wps office

Frequently Asked Questions

Why does my embedded OneDrive file suddenly require a login?

This usually happens if the file's sharing permissions are set to 'People in your organization' or 'Specific people' rather than 'Anyone with the link'. It can also occur if your IT administrator recently updated security policies restricting anonymous access.

Can I embed a OneDrive file securely without making it fully public?

Yes. If you set the sharing permissions to require an organizational account, you can still embed the file. However, viewers will be prompted to sign in with an authorized Microsoft account to view the content within the iframe.

What if the 'Anyone with the link' option is greyed out in OneDrive?

If this option is disabled, your school or company's Microsoft 365 administrator has disabled external or anonymous sharing globally. You will need to contact your IT department to request permission or use an alternative platform to host the file.