Is there a way to allow OneDrive files to open in iframe in a third-party multi-tenant app, if the tenant uses Azure AD as IdP to SSO?

Jaya Bandyopadhyay 1 Reputation point
2022-02-23T22:45:29.627+00:00

Sharepoint and OneDrive public links (anyone can view) are not allowed to be iframed in a third-party app by design with XFRAME_OPTIONS = Same origin policy.

I am wondering if there is a way to white-list the domain by customer so that customer's OneDrive files can be shown in iframe in that domain.
Example : customer.saas_vendor.com logs in employees in that customer tenant via SSO (Azure AD as IdP).
Now, customer wants to pick OneDrive files and display in iframe in saas_vendor app.
CORS does not allow it. But, is there "OneDrive for saas_vendor" app (similar to "OneDrive for Slack") can be created where OneDrive files can be displayed in an iframe in customer.saas_vendor.com? OneDrive for Slack only allows the preview of the file, clicking on it opens in new tab.

Hoping to get a simple answer :-)

Microsoft 365 and Office | SharePoint | Development
Microsoft 365 and Office | OneDrive | For business | Windows
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. JoyZ 18,111 Reputation points
    2022-02-24T05:35:42.487+00:00

    @Jaya Bandyopadhyay ,

    As far as I know, we cannot do this, check this article for details:

    https://learn.microsoft.com/en-us/sharepoint/troubleshoot/sites/cannot-display-sharepoint-pages-in-iframe


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.