Spring安全性https身份验证

时间:2015-01-22 13:29:46

标签: java spring spring-mvc tomcat spring-security

我正在使用spring security 3.2.5和Tomcat 7.当我尝试进入需要身份验证的页面(在通过https的远程服务器上)时,我没有被重定向到默认的spring security登录表单。

我的security.xml:

<security:intercept-url pattern="/**"
            access="isAuthenticated()" requires-channel="https"/>

        <security:port-mappings>
            <!-- Default ports -->
            <security:port-mapping http="8080" https="443" />
        </security:port-mappings>

我得到的错误:

Google Chrome's connection attempt to X.X.XXX.42 was rejected. The website may be down, or your network may not be properly configured.ERR_CONNECTION_REFUSED

我尝试按照本教程:Link

块引用

1 个答案:

答案 0 :(得分:0)

您说(在评论中)您可以使用HTTPS直接访问登录页,但是当您尝试通过负载均衡器时,您会遇到错误。

我认为您不仅要配置tomcat以使用HTTPS,还要配置负载均衡器。如果您使用F5,this link可能会有所帮助。

(作为旁注,此问题的标记应从“弹簧安全”改为“负载均衡器”等......)