Fix OneDrive Asking for Sign-In When Embedding Files on Websites
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.
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.
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.
Locate the file in your OneDrive online directory, right-click it, and select 'Share' from the context menu.
Click on the current permission level (e.g., 'People in your organization') and change it to 'Anyone with the link'. Apply the changes.
Close the share dialog, select the file again, and choose 'Embed' from the top menu to generate and copy a fresh iframe snippet.
Replace the old embed code on your website or Moodle page with the newly generated iframe code.
Open a private or incognito browser window, navigate to your webpage, and confirm that the embedded file displays without prompting for a login.
Use a Direct Sharing Link Instead of Embedding
If organizational policies strictly block anonymous embedding, bypass the iframe restrictions by providing a standard clickable sharing link directly on the website.
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. Download and install: Get WPS Office for free from the official website and install it on your device.
- 2. Upload to WPS Cloud: Open your document in WPS Office and save it directly to your integrated WPS Cloud.
- 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.

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.




