附上了我的上下文提供的SAMLContextProviderLB豆Spring Security的SAML,重定向的页面,而不是去到HTTP HTTPS的使用SAMLContextProviderLB设置为https配置
**<property name="scheme" value="https"/>**
<property name="serverName" value="${sp.hostname}"/>
<property name="serverPort" value="#{'${sp.ssl.port}'=='' ? 443 : '${sp.ssl.port}'}"/>
<property name="includeServerPortInRequestURL" value="#{'${sp.ssl.port}'=='443' ? false : true }"/>
<property name="contextPath" value="/${sp.context.root}"/>
我是一个反向代理服务器后面,所以我卸载了SSL终止。后端服务器本身正在侦听非SSL,但是webtier正在为我们终止SSL并转发到非SSL端口。我已经使用上述属性设置了SAMLContextProviderLB,因此即使后端是https,它也会知道将saml令牌的预期收件人映射为https受众。然而,我在下面的日志中看到,当我访问受保护的资源时,它在浏览器上返回垃圾。当我在浏览器中将其更改为https时,它按预期工作。看到下面的日志显示,从DefaultSavedRequest url 返回的值是HTTP,它应该是HTTP。
2016-03-07 18:24:11,907 INFO org.springframework.security.saml.log.SAMLDefaultLogger.log:127 - AuthNResponse; SUCCESS; 10.4.203.88; https://myserver:89/fct;https://www.myADFS.com/adfs/services/trust;[email protected] ;;
2016-03-07 18:24:11,909 DEBUG org.springframework.security.saml.SAMLProcessingFilter.successfulAuthentication:317 - 认证成功。更新SecurityContextHolder以包含:org.springf[email protected]830e9237:Principal:[email protected];证书:[PROTECTED];已验证:true;详细信息:null;未授予任何机关
2016年3月7日18:24:11,910 DEBUG org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler.onAuthenticationSuccess:79 - 重定向到DefaultSavedRequest网址:HTTP:// MYSERVER: 89/FCT /页
2016年3月7日18:24:11911 DEBUG org.springframework.security.web.DefaultRedirectStrategy.sendRedirect:36 - 重定向到 'http://myserver:89/fct/page'
2016年3月7日18: 24:11,911 DEBUG org.springframework.security.web.context.HttpSessionSecurityContextRepository.saveCon文本:292 - SecurityContext存储到HttpSession:'[email protected]0e9237:身份验证:org.springf[email protected]830e9237:主体:[email protected];证书:[PROTECTED];已验证:true;详细信息:null;未授予任何当局
2016年3月7日18:24:11912 DEBUG org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter:97 - SecurityContextHolder中已被清除,已完成
任何想法,请求处理如何在此设置下强制使用HTTPS?提前致谢。