我正在使用oidc JS cilent库OIDC JS。
我有连接到 WSO2 IDP服务器的客户端代码,使用openID连接endpoints.The流在WSO2服务器上配置隐式。
WSO2版本:wso2is-5.3.0
正常的登录功能很好。当涉及到对访问令牌的无声刷新时,它会失败。我正在使用oidc的"signinSilent“方法通过iframe进行无声登录并获得最新的访问令牌。
这在Gluu服务器上很好。
这是我们收到的错误的截图,
错误:
Refused to display '<idp authz url>' in a frame because it set 'X-Frmae-Options' to 'deny'
发布于 2021-04-29 14:01:30
您可以转到{carbonhome}/repository/deployment/server/webapps/oauth2/WEB-INF并将其添加到HttpHeaderSecurityFilter中:
<init-param>
<param-name>antiClickJackingEnabled</param-name>
<param-value>false</param-value>
</init-param>
这将禁用X帧选项标头,从而允许所有域.但是,在做这件事时要小心。您还可以设置antiClickJackingOptions并定义允许其使用的域。
发布于 2021-08-05 15:56:46
为了避免这个问题,必须将调用Identity Server的域添加到oauth2 web应用程序中,WSO2提供的域位于CORS的筛选器中。要做到这一点,只需修改该文件:
<wso2is_home>/repository/deployment/server/webapps/oauth2/WEB-INF/web.xml
并在param-name cors.allowed.origins中添加要允许的基本URL:
[...]
<filter>
<filter-name>CorsFilter</filter-name>
<filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
<init-param> <param-name>cors.allowed.origins</param-name>
<param-value>https://whatever.com, https://whatever2.com</param-value>
</init-param>
[...]
修改此代码并重新启动WSO2 IS之后,浏览器将不再阻止它。
https://stackoverflow.com/questions/46786265
复制相似问题