Legacy Knowledge Base
Published Jun. 30, 2025

Unable to embed widgets even with "Allow users to add to any website" enabled

Written By

Dia Seung

How To articles are not official guidelines or officially supporteddocumentation. They are community-contributed content and may not alwaysreflect the latest updates to Liferay DXP. We welcome your feedback toimprove How to articles!

While we make every effort to ensure this Knowledge Base is accurate, itmay not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with anyfeedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack"publication program, made available for informational purposes. Articlesin this program were published without a requirement for independentediting or verification and are provided "as is" withoutguarantee.

Before using any information from this article, independently verify itssuitability for your situation and project.

Issue

  • I cannot embed widgets on another site (with a different domain) even though I have the checkbox "Allow users to add <portlet> to any website" enabled.
  • "<Hostname> refused connection" error may be seen. 

Environment

  • Liferay DXP 7.3

Resolution

  • Currently, the checkbox "Allow users to add <portlet> to any website" only impacts specifically Widget Pages.
    • The purpose of this configuration is to allow a new portlet menu item "Add to any Website" in widget pages.
    • This portlet menu item will then open a popup containing the iframe code similar to Portlet Preferences > Sharing tab. 
  • The issue blocking widget embedding is that Liferay will block embedding to different domains through X-FRAME-Options, in order to prevent clickjacking. You can verify this by viewing the browser console and checking for an X-FRAME-Options error. 
  • To enable the widget to be embedded, configure the X-FRAME-Options for the widget and the destination domain in the system-ext.properties file as below:
http.header.secure.x.frame.options.1=/widget/web/guest/<widget-uuid>/ |ALLOW-FROM https://<other-domain>

 The <widget-uuid> can be obtained from the iframe code.

    • Please note that the system-ext.properties file is set in the platform installation's class path (such as {LR_HOME}/{Tomcat}/WEB-INF/classes/ for Tomcat).

 

Additional Information

Did this article resolve your issue ?

Legacy Knowledge Base