Products

Solutions

Resources

Partners

Community

Blog

About

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...How to allow iFrame content on DNN site - X-Frame-optionHow to allow iFrame content on DNN site - X-Frame-option
Previous
 
Next
New Post
3/27/2019 2:15 PM
 

Hi, I'm running a couple of DNN instances - one internet , one intranet, both are DNN 9.1.1 (The internet site was started around DNN 6 and upgraded to 9.1.1 over time, the intranet site started with DNN 9 I believe).

I'm trying to use an iFrame to show some content from the intranet site, and it wont allow it (whether from a separate site domain, or the same site / domain) It gives a "This content cannot be shown in an iFrame" message.

I can iFrame content from the internet site with no problem.

I've read a bit about X-Frame-Options, in the global.asax and the web.config files. I don't see any X-frame-options settings for these in either site.

Any insight into how to allow iFrames to work for a site? (Or is this a different setting on the web server?)

Thanks,
Tom

 

 
New Post
3/28/2019 2:50 AM
 

Tom,

X-Frame-Options is an HTTP response header, and there are multiple places where it could be added - sometimes there is a Web Application Firewall between the web server and the evil internet, so it could as well be added there. Also MVC does add this header since (don't know).

When it is in the web.config file, it typically looks like this:

<system.webServer>
...
   <httpProtocol>
   ...
      <customHeaders>
         ...
         <add name="X-Frame-Options" value="SAMEORIGIN" />
         ...
      </customHeaders>
      ...
   </httpProtocol>
   ...
</system.webServer>

Unfortunately you don't have much options. DENY (denies it always), SAMEORIGIN (allows displaying the document from the same web server) and ALLOW-FROM https://example.com/ (allows it from this domain only). And the bad thing with the last option is: it does not allow multiple domains to be entered.

And: It is deprecated. It should be replaced by a CSP (Content Security Policy) statement, like

Content-Security-Policy: frame-ancestors 'self' example.com *.example.net;

You see you can allow multiple ancestors if you use this. But be careful with creating a CSP, chances are good that your site won't work anymore. There is a report-only option that displays possible issues in the browser console, so it is good to test it against all pages of your site this way. And you can use the great report-uri.com as a good tool for creating and maintaining your CSP.

Happy DNNing!
Michael


Michael Tobisch
DNN★MVP

dnn-Connect.org - The most vibrant community around the DNN-platform
DNN Connect 2020
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...How to allow iFrame content on DNN site - X-Frame-optionHow to allow iFrame content on DNN site - X-Frame-option


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out