Embed SharePoint online site page into iframe

Ivan K 0 Reputation points
2023-12-12T07:11:20.2966667+00:00

Hello,

i am trying to embed SharePoint Online site page into iframe on my web site and getting such error message in chrome:

Refused to frame 'https://eloomi.sharepoint.com/' because an ancestor violates the 

following Content Security Policy directive: "frame-ancestors 'self' teams.microsoft.com 

*.teams.microsoft.com *.skype.com *.teams.microsoft.us local.teams.office.com *.powerapps.com 

*.yammer.com engage.cloud.microsoft *.officeapps.live.com *.office.com *.microsoft365.com

 *.stream.azure-test.net *.microsoftstream.com *.dynamics.com *.microsoft.com onedrive.live.com 

 *.onedrive.live.com securebroker.sharepointonline.com".

That is 100% headers issue from SharePoint Online site.

Is any way to configure SharePoint Online site pages to been embedded (iframed) on another web site into iframe?

Microsoft 365 and Office | SharePoint | Development
Microsoft 365 and Office | SharePoint | For business | Windows
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 40,476 Reputation points Microsoft External Staff
    2023-12-14T02:45:17.05+00:00

    Hi @Ivan K,

    The error message means that you are trying to frame a page that has set specifically which other sites are allowed to frame it. If your hostname is not on that list, there is nothing you can do, except modifying headers by proxying the service ofc. In some cases services that restrict framing allow for configuration, so you should check if this is possible to allowlist your site to frame it.


    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.


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.