From c0426179368f9069e5b77194de22a540a771983e Mon Sep 17 00:00:00 2001 From: Robert Kohanyi Date: Sat, 16 Apr 2016 14:20:12 +0100 Subject: [PATCH 1/4] Add (commented out) config for Spring Channel Security --- .../main/java/org/baeldung/spring/SecSecurityConfig.java | 8 ++++++++ .../src/main/resources/webSecurityConfig.xml | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/spring-security-mvc-login/src/main/java/org/baeldung/spring/SecSecurityConfig.java b/spring-security-mvc-login/src/main/java/org/baeldung/spring/SecSecurityConfig.java index 08cb09384b..0cc6df19ae 100644 --- a/spring-security-mvc-login/src/main/java/org/baeldung/spring/SecSecurityConfig.java +++ b/spring-security-mvc-login/src/main/java/org/baeldung/spring/SecSecurityConfig.java @@ -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") diff --git a/spring-security-mvc-login/src/main/resources/webSecurityConfig.xml b/spring-security-mvc-login/src/main/resources/webSecurityConfig.xml index ec4cf60eb5..0b77e64c74 100644 --- a/spring-security-mvc-login/src/main/resources/webSecurityConfig.xml +++ b/spring-security-mvc-login/src/main/resources/webSecurityConfig.xml @@ -11,6 +11,12 @@ + @@ -19,6 +25,9 @@ + From cddd15019c64a5dcc80f505af530a81d99356a43 Mon Sep 17 00:00:00 2001 From: Robert Kohanyi Date: Sun, 24 Apr 2016 20:48:07 +0100 Subject: [PATCH 2/4] Refined the url pattern for perform_login, remove permitAll (it's not needed, works either way) --- .../src/main/java/org/baeldung/spring/SecSecurityConfig.java | 2 +- .../src/main/resources/webSecurityConfig.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spring-security-mvc-login/src/main/java/org/baeldung/spring/SecSecurityConfig.java b/spring-security-mvc-login/src/main/java/org/baeldung/spring/SecSecurityConfig.java index 0cc6df19ae..b4d0a6466b 100644 --- a/spring-security-mvc-login/src/main/java/org/baeldung/spring/SecSecurityConfig.java +++ b/spring-security-mvc-login/src/main/java/org/baeldung/spring/SecSecurityConfig.java @@ -39,7 +39,7 @@ public class SecSecurityConfig extends WebSecurityConfigurerAdapter { .anyRequest().authenticated() .and() //.requiresChannel() - //.antMatchers("/login*", "/perform_log*").requiresSecure() + //.antMatchers("/login*", "/perform_login").requiresSecure() //.anyRequest().requiresInsecure() //.and() //.sessionManagement() diff --git a/spring-security-mvc-login/src/main/resources/webSecurityConfig.xml b/spring-security-mvc-login/src/main/resources/webSecurityConfig.xml index 0b77e64c74..460f3422d5 100644 --- a/spring-security-mvc-login/src/main/resources/webSecurityConfig.xml +++ b/spring-security-mvc-login/src/main/resources/webSecurityConfig.xml @@ -14,12 +14,12 @@ - + From 01be10edbb7cc5dd94b337f3cf92bb57617248d5 Mon Sep 17 00:00:00 2001 From: Robert Kohanyi Date: Mon, 2 May 2016 16:11:59 +0100 Subject: [PATCH 3/4] /anonymous.html doesn't require http to set explicitely after we set it for /** --- .../src/main/resources/webSecurityConfig.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-security-mvc-login/src/main/resources/webSecurityConfig.xml b/spring-security-mvc-login/src/main/resources/webSecurityConfig.xml index 460f3422d5..3bba50a87d 100644 --- a/spring-security-mvc-login/src/main/resources/webSecurityConfig.xml +++ b/spring-security-mvc-login/src/main/resources/webSecurityConfig.xml @@ -12,7 +12,7 @@ @@ -24,10 +18,6 @@ always-use-default-target="true"/> - -