Magento Tips & Tricks

Magento 2: Allow backend run in frame

Recently I’ve got request to make magento backend working in iframe. Quick googling gives me link to official documentation with instructions on how to setup storefront to be displayed in iframe. I did not pay attention to storefront word at that point. Backend still not work in iframe and gives an error:

Apparently changes suggested by documentation did not work for backend. Further investigation gives me following files to check:

It appear that there is separate constant for backend in XFrameOptions.php. To update it you need to change following code:

Useful Links

Magento 1 not working in iframe?
Magento Documentation – X-Frame-Options header

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.