SharePoint iframe doesn't allow another site collection links

Cherry P 21 Reputation points
2023-08-31T19:04:25+00:00

Hi,

We are using SharePoint server 2019. I am trying to display an another site collection page in the iframe code in a different site collection within the same SharePoint farm. I get "site refused to connect error". I checked in the Edge developer tools and found the error below.

Eg: In the ABC site collection (https://ABC.company.org), I am trying to display XYZ site collection's page (https://XYZ.company.org) in the Embed web part using an iframe.

Error message:

“Refused to display 'https://XYZ.company.org' in a frame because it set 'X-Frame-Options' to 'sameorigin' "

Both site collections are in the same SharePoint farm. In both site collections, we set HTML Field Security option to allow any external domain in the iframe.

X-Frame-Options:

DENY - The page cannot be displayed in a frame, regardless of the site attempting to do so.

SAMEORIGIN - The page can only be displayed if all ancestor frames are same origin to the page itself.

I am wondering is this by design? Microsoft doesn’t allow to iframe other SharePoint site collection pages in a different site collection with in the same farm? Or is this some other security related outside of SharePoint in our organization?

I have the same issue using page viewer web part in the classic SharePoint pages.

Any insight/suggestions are greatly appreciated.

Thanks

SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,336 questions
SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,605 questions
SharePoint Server Management
SharePoint Server Management
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Management: The act or process of organizing, handling, directing or controlling something.
2,938 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. ChengFeng - MSFT 5,020 Reputation points Microsoft Vendor
    2023-09-01T07:30:09.8966667+00:00

    HI @Cherry P

    Thanks for letting us know your user experience. According to your case description, I do understand how frustrated you are now.

     

    When I received the case, I searched a lot of documents did a lot of researches. And I feel regretful to inform you that it turns out to be a by-design one.

     

    Here is a link for your reference:

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

    And I noticed that some end users have also proposed the same request, it is highly recommended that you can vote this ticket. Many features of our current products are designed and upgraded based on customers’ feedback. With requirements like this increase, the problem may well be released in the future. Thanks for your understanding.

     

    feedback


    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.

    Best Regards

    Cheng Feng


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.