Problem/Motivation
We have setup a second domain to satisfy the oEmbed iframe warning. The second domain (www3.*) is fully functional with valid SSL certificate etc. and the URL is added to the Media settings configuration (/admin/config/media/media-settings) as "https://www3.xxx.xx.xx". However, when page with oEmbed content is loaded in the client browser, iframe is refusing to load the embedded content.



| Comment | File | Size | Author |
|---|---|---|---|
| Screenshot_2022-08-04_18-03-35_Original.png | 47.11 KB | jmouse888 | |
| Screenshot_2022-08-04_18-03-13_Original.png | 57.23 KB | jmouse888 | |
| Screenshot_2022-08-04_18-04-17_Original.png | 106.56 KB | jmouse888 |
Comments
Comment #2
cilefen commentedDrupal 8 is unsupported.
Comment #3
larowlanCheck your CSP headers
Comment #4
jmouse888 commented@cilefen Sorry, this is actually on D9 latest. Set the version to 8.9x-dev because the issue has existed since 8.9x. I will update the version.
@larowlan I did try to set CSP but not sure if it's helping. Could you give me a bit more details on what to put and on which site? I have set CSP on the parent site (www) and on the oembed site (www3). neither is helping. Could you give some examples? in this case, say the original site is www.example.com, and oembed site is www3.example.com, and the video content is a youtube video. What should the CSP tag look like and on which site should it be set? Thanks a lot for the help!
Comment #5
jmouse888 commentedComment #6
longwaveThis is related to, and perhaps, a duplicate of #3075685: Should "iFrame domain" also set "X-Frame-Options" header . Core sets
X-Frame-Options: SAMEORIGINby default, which means content cannot be embedded from other domains, which is at odds with this feature.The comments in that issue suggest setting a CSP header can override X-Frame-Options.
Comment #7
cilefen commentedWhat does the browser console log?
Comment #8
jmouse888 commentedGot it to work!
I installed the CSP module and added "*.example.com" to "frame-ancestors".
So to sum up for those struggling to get this to work:
Comment #10
cilefen commented