この記事は、Liferay Digital Experience PlatformsのX-Frame-Optionsを変更したい人を支援するためのものです。 通常、これは、ウィジェットをポートレットまたはiFrameに埋め込み、HTTPヘッダーがクリックジャックから保護されるようにする場合に必要です。
これらの値は、portal-impl.jar内にある system.properties ファイル(portal.propertiesファイルではありません )にあります 。
# Set this to true for the portal to send the "X-Frame-Options: DENY" HTTP
# header to protect against clickjacking.
#
# Custom HTTP header values instead of "DENY" can be specified per URL via
# the properties "http.header.secure.x.frame.options.*".
#
http.header.secure.x.frame.options=true
#
# 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
解決策
デフォルト設定を上書きするには、 system-ext.properties ファイルを作成します。 portal.properties ファイルと同様に、ベストプラクティスとして、 system.propertiesを 直接変更しないでください。そのためには、ネストされた各ウィジェットは次のようになります
http.header.secure.x.frame.options.1 = /{truncated portal page url} |ALLOW-FROM {web page URL}
例:
http.header.secure.x.frame.options.1=/group/guest/dxp-private-page |ALLOW-FROM https://www.liferay.com/group/customer
終了したら、 system-ext.properties ファイルを \..\ROOT\WEB-INF\classes フォルダに配置します。変更を適用するには、サーバーの再起動が必要になる可能性があります。
追加情報
より一般的な情報については、 System-ext.properties Reference Guide を参照してください。