legacy-knowledge-base
公開されました Jul. 2, 2025

外部サイトでウィジェットを共有する際の接続/認証エラー

written-by

Liferay Support

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

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

legacy-article

learn-legacy-article-disclaimer-text

Liferayポートレットを外部サイトと共有しようとすると、接続/認証エラーが発生する場合があります。

再現する手順:

  1. ブログポートレット(または任意のポートレット)をページに追加します
  2. ブログをブログポートレットに追加します
  3. 設定>共有  を選択し、スクリプトをコピーして外部サイトとの共有を選択します
  4. 別のIPで新しいLiferayインスタンスを開きます
  5. Webコンテンツ表示ポートレットをページに追加します
  6. 記事を追加します
  7. ソースを選択し、スクリプトを追加します
  8. Internet Explorer(IE)10で、Webコンテンツの記事を含むページを表示します

期待される結果:

外部サイトにポートレットが表示されます。

実結果:

ポートレットは表示されません。IEでは、ユーザーはWebコンテンツ表示内に 「このコンテンツはフレームに表示できません」 というメッセージを受け取ります(LiferayではなくIEメッセージのように見えます)。

Firefoxでは、Webコンテンツ表示は空白です。

解決策

この問題は、 portal-ext.properties ファイルに以下のプロパティを設定することで解決されます。

# If the property "http.header.secure.x.frame.options" is set to true, then
# the portal will iterate through the properties
# "http.header.secure.x.frame.options.*" where the wildcard "*"
# is replaced with an int number starting from 0 and ending with 255 to find
# a pipe (|) delimited URL and HTTP header value pair (e.g. "/|SAMEORIGIN").
#
# Upon finding a matched a URL, the portal will use the custom HTTP header
# value instead of the "DENY" value.
#
# By default, URLs that start with "/" will use a custom HTTP header value
# of "SAMEORIGIN". Specify another URL and HTTP header value with a number
# smaller than 255 to intercept this default behavior.
#
http.header.secure.x.frame.options.255=/|SAMEORIGIN

たとえば、ブログウィジェットを共有する場合、以下の方法でプロパティを設定します。

http.header.secure.x.frame.options.1=/widget/web/guest/home/-/blogs

追加情報

did-this-article-resolve-your-issue

legacy-knowledge-base