Add (commented out) config for Spring Channel Security

This commit is contained in:
Robert Kohanyi 2016-04-16 14:20:12 +01:00
parent 0adca43706
commit c042617936
2 changed files with 17 additions and 0 deletions

View File

@ -38,6 +38,14 @@ public class SecSecurityConfig extends WebSecurityConfigurerAdapter {
.antMatchers("/login*").permitAll()
.anyRequest().authenticated()
.and()
//.requiresChannel()
//.antMatchers("/login*", "/perform_log*").requiresSecure()
//.anyRequest().requiresInsecure()
//.and()
//.sessionManagement()
//.sessionFixation()
//.none()
//.and()
.formLogin()
.loginPage("/login.html")
.loginProcessingUrl("/perform_login")

View File

@ -11,6 +11,12 @@
<intercept-url pattern="/anonymous*" access="isAnonymous()"/>
<intercept-url pattern="/login*" access="permitAll"/>
<intercept-url pattern="/**" access="isAuthenticated()"/>
<!--
<intercept-url pattern="/anonymous*" access="isAnonymous()" requires-channel="http"/>
<intercept-url pattern="/login*" access="permitAll" requires-channel="https"/>
<intercept-url pattern="/perform_log*" access="permitAll" requires-channel="https"/>
<intercept-url pattern="/**" access="isAuthenticated()" requires-channel="http"/>
-->
<csrf disabled="true"/>
@ -19,6 +25,9 @@
<logout logout-url="/perform_logout" delete-cookies="JSESSIONID" success-handler-ref="customLogoutSuccessHandler"/>
<!--
<session-management session-fixation-protection="none"/>
-->
</http>
<beans:bean name="customLogoutSuccessHandler" class="org.baeldung.security.CustomLogoutSuccessHandler"/>