tomcat - Is there any way to force https for some pages in spring-security? -


I am currently using Tomcat 6 and Spring-protection 3.0.3. Apache without RELEASE

I can force https for the login page and it works just fine.

The next configuration is used to prevent access to some pages by http.

  & lt; Http usage- expressions = "true" & gt; & Lt; Intercept-url pattern = "/" access = "permitAll" /> & Lt; Intercept-url pattern = "/ login" access = "permitAll" is required-channel = "https" /> & Lt; Intercept-url pattern = "/ spring_security_login" access = "permitAll" is required-channel = "https" /> & Lt; Intercept-url pattern = "/ users / new" access = "permitAll" is required -Channel = "https" /> & Lt; Intercept-url pattern = "/ user / authorize / *" access = "isAuthenticated ()" /> & Lt ;! - & lt; Form-login / & gt; - & gt; & Lt; Form-login login-page = "/ login" / & gt; & Lt; Logout / & gt; & Lt; Memorize / & gt; & Lt ;! - To enable X509 client authentication support, uncomment & lt; X509 / & gt; - & gt; & Lt ;! - To limit the number of sessions to a user - & gt; & Lt; Session Management & gt; & Lt; Concurrency-control max-session = "10000" error-if-max-more = "true" /> & Lt; / Session-management & gt; & Lt; / Http & gt;   

But if I try to reach them, for example, non-https link http: // localhost: 8085 / path / by / buyers / new

  The page is not redirecting properly Firefox has detected that the server is redirecting the request to this address in a way that is never complete. * This problem can sometimes be caused by rejecting or rejecting cookies.   

Cookies are allowed so I think this is not a problem. When I tried to access the link given above, I found an error in Chrome.

The SSL port in my configuration port 8085 is not configured on port 8443 and it works fine.

I would like to have all access attempts redirected to https for some pages.

Any advice would be highly appreciated.

The best connection is,

Add a section to your http configuration:

  & lt; Http use-expressions = "true" & gt; ... & lt; Port-Mapping & gt; & Lt; Portmapping http = "8085" https = "8443" /> & Lt; / Port-Mapping & gt; & Lt; / Http & gt;    

Comments