Spring security docs state (2.3.2):
If your application supports both HTTP and HTTPS, and you require specific URLs to be accessible only through HTTPS, then this is directly supported using the required channel attribute:
<http> <intercept-url pattern="/secure/**" access="ROLE_USER" requires-channel="https"/> <intercept-url pattern="/**" access="ROLE_USER" requires-channel="any"/> ... </http>
But I use annotations for my controllers, not url-capture elements.
- Can HTTPS be enforced through annotations?
- Can I force HTTP for insecure pages?
java spring-security
David parks
source share