# Prevent iframe clickjacking (using X-Frame-Options header)

**URL:** <https://community.auth0.com/t/prevent-iframe-clickjacking-using-x-frame-options-header/23087>\
**Category:** Get Help\
**Tags:** security\
**Created:** [March 25, 2019, 4:13pm UTC](https://community.auth0.com/t/prevent-iframe-clickjacking-using-x-frame-options-header/23087 "2019-03-25T16:13:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![flo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/flo/32/12006_2.png) [@flo](https://community.auth0.com/u/flo)\
**Post date:** [March 25, 2019, 4:13pm UTC](https://community.auth0.com/t/prevent-iframe-clickjacking-using-x-frame-options-header/23087/1 "2019-03-25T16:13:08Z")

</div>

Is there a way to prevent Auth0 login pages to be presented in an iframe? For non Auth0 pages, one would set the `X-Frame-Options` header to `DENY`. But can those headers be set on an Auth0 login page as well?

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [April 5, 2019, 10:37am UTC](https://community.auth0.com/t/prevent-iframe-clickjacking-using-x-frame-options-header/23087/3 "2019-04-05T10:37:14Z")

</div>

From a technical point of view it’s possible for you to include that header if you can use a custom domain with self-managed certificates ([Configure Custom Domains with Self-Managed Certificates](https://auth0.com/docs/custom-domains/self-managed-certificates)). However, this is mostly because in that flow you have to have a reverse proxy which could add HTTP headers.

In addition, the use of that approach does not prevent the original tenant domain to be accessed and if accessed through that domain the header would not be present.

I can also let you know that we tracking this particular situation and have intentions to include additional headers like the one you mentioned by default, however, this would technically be a breaking change so there’s some additional consideration to this process.

---

<div class="post-metadata">

**Author:** ![flo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/flo/32/12006_2.png) [@flo](https://community.auth0.com/u/flo)\
**Post date:** [April 5, 2019, 11:31am UTC](https://community.auth0.com/t/prevent-iframe-clickjacking-using-x-frame-options-header/23087/4 "2019-04-05T11:31:57Z")

</div>

It would be very nice if we could specify arbitrary headers ourselves somewhere in the Auth0 config. That would mean no breaking changes for customers. We can already customize the HTML for the login pages, why not the HTTP headers as well?

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [April 5, 2019, 2:03pm UTC](https://community.auth0.com/t/prevent-iframe-clickjacking-using-x-frame-options-header/23087/5 "2019-04-05T14:03:04Z")

</div>

I think (personal opinion) that allowing arbitrary headers would be a bit too much, but I understand that having some configurability could be interesting. However, it’s the configurability part that leads to additional considerations mentioned above. In software going from completely controlled by the service to even just the smallest bit of configurability it’s a huge gap to cover.

Not saying that it should not be done, just calling the attention to the fact that sometimes in software the smallest functional change requires an enormous behind the scenes refactoring.

As I mentioned, we are already tracking this situation from the perspective of the service providing additional headers by default including this one. However, if you’re looking to go further and have additional control you should leave your feedback at [Auth0: Secure access for everyone. But not just anyone.](http://auth0.com/feedback) as that goes straight to the product team.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [September 2, 2019, 8:51am UTC](https://community.auth0.com/t/prevent-iframe-clickjacking-using-x-frame-options-header/23087/6 "2019-09-02T08:51:48Z")

</div>


