如何在WSO2 5.4.1中启用X-Frame-Options?

时间:2019-01-04 15:31:57

标签: wso2 wso2carbon x-frame-options

我尝试按照文档中的说明配置我的jaggery.conf文件,以允许如下进行取景:

1/5/2019, 1/6/2019, 1/7/2019

尽管如此,在我的客户端应用中,我仍然收到一条消息,指出不允许进行构架。

"filters":[
      {
        "name":"HttpHeaderSecurityFilter",
        "class":"org.apache.catalina.filters.HttpHeaderSecurityFilter",
        "params" : [
            {"name" : "hstsEnabled", "value" : "false"},
                        { "name": "antiClickJackingOption", "value": "SAMEORIGIN" }
             ]
      },
      {
        "name": "ContentTypeBasedCachePreventionFilter",
        "class": "org.wso2.carbon.ui.filters.cache.ContentTypeBasedCachePreventionFilter",
        "params":[
          {"name": "patterns", "value": "text/html\" ,application/json\" ,plain/text"},
          {"name": "filterAction", "value": "enforce"},
          {"name": "httpHeaders", "value": "Cache-Control: no-store, no-cache, must-revalidate, private"}
        ]
      }
    ],

1 个答案:

答案 0 :(得分:1)

由于此问题来自authenticationendpoint,因此您必须按如下所示在文件HttpHeaderSecurityFilter中配置<IS_HOME>/repository/deployment/server/webapps/authenticationendpoint/WEB-INF/web.xml过滤器。

<filter>
    <filter-name>HttpHeaderSecurityFilter</filter-name>
    <filter-class>org.apache.catalina.filters.HttpHeaderSecurityFilter</filter-class>
    <init-param>
        <param-name>hstsEnabled</param-name>
        <param-value>false</param-value>
    </init-param>
    <init-param>
        <param-name>antiClickJackingOption</param-name>
        <param-value>SAMEORIGIN</param-value>
    </init-param>
</filter>

顺便说一句,共享URL中的错误是Registered+callback+does+not+match+with+the+provided+url,您可以检查请求URL中定义的redirect_uri是否与服务提供商中配置的URL匹配。