본문 바로가기
Programming/Spring

[spring-security] http->https 로 사용되게 제어하기

by 막이 2015. 11. 25.

spring-security.xml 에서 



<http auto-config = "true" realm = "Web UI" use-expressions = "true"> <intercept-url pattern = "/**" filters = "none" requires-channel = "https" >

<port-mappings>

<port-mapping http="80" https="443"/>

</port-mappings> </http>


requires-channel="https"의 역힐은 정의된 패턴 URL을 http로 접근하면 https url로 redirect를 시켜주는 것이다.
https로 접근해야 할 URL들을 강제화 하는 역할로 이해하면 됨


모든 url 에 대해서 https 로 강제 전환~!

보통 로그인이나 회원가입 이런 부분에서 https 많이쓰고. 모든 페이지에서 쓰는 경우는 드물다