Recently I had the requirement to embed an external website onto a modern page on a SharePoint Online site. Fine, that’s no problem at all. This is available out-of-the-box on a modern page, right?
Let’s proceed by providing the external content’s URL in the properties of the webpart.
The error message reads: This website doesn’t support embedding using just the address. Try pasting the embed code instead. If it’s important to embed from this site using just the address, please send us feedback.
Fair enough, let me try by adding an HTML iframe-tag.
The error message reads: Embedding content from this website isn’t allowed, but your admin can change this setting. They will need to add ‘www.laurentschoenaers.be’ to the list of sites that are allowed.
I clicked the guidance url, that lead me to a Microsoft Office support page.
At this point you need to add the URL to the external content in the HTML Field Security, through Site Settings. If the link is not there, scripting might be turned off. This is turned on on the tenant I’m working, so no problem right?
I wouldn’t be writing this post if everything went as expected, isn’t it? 🙂
As you could already expect, no HTML Field Security to be found in the settings of this site. Great! Navigating to the URL (https://[tenant].sharepoint.com/sites/[site]/_layouts/15/htmlfieldsecurity.aspx) gives an “Sorry, you don’t have access to this page” error.
Luckily for us we have PowerShell to fix this one.
Connect-SPOService -URL https://[tenant]-admin.sharepoint.com
Set-SPOSite https://[tenant].sharepoint.com/sites/[site] -DenyAddAndCustomizePages $false
By executing this script, the HTML Field Security link becomes visible and accessible from the site settings.
We can now add our domain to use as external content in a SharePoint Online site or an Office 365 Group.
There we go.