diff --git a/spring-boot-samples/spring-boot-sample-web-secure-custom/src/main/java/sample/web/secure/custom/SampleWebSecureCustomApplication.java b/spring-boot-samples/spring-boot-sample-web-secure-custom/src/main/java/sample/web/secure/custom/SampleWebSecureCustomApplication.java index 469e3bc59c..6fbf9dd61e 100644 --- a/spring-boot-samples/spring-boot-sample-web-secure-custom/src/main/java/sample/web/secure/custom/SampleWebSecureCustomApplication.java +++ b/spring-boot-samples/spring-boot-sample-web-secure-custom/src/main/java/sample/web/secure/custom/SampleWebSecureCustomApplication.java @@ -76,7 +76,7 @@ public class SampleWebSecureCustomApplication extends WebMvcConfigurerAdapter { protected void configure(HttpSecurity http) throws Exception { http.authorizeRequests().antMatchers("/css/**").permitAll().anyRequest() .fullyAuthenticated().and().formLogin().loginPage("/login") - .failureUrl("/login?error").permitAll(); + .failureUrl("/login?error").permitAll().and().logout().permitAll(); } @Override diff --git a/spring-boot-samples/spring-boot-sample-web-secure-custom/src/main/resources/templates/home.html b/spring-boot-samples/spring-boot-sample-web-secure-custom/src/main/resources/templates/home.html index 6fa69dc027..024fee0209 100644 --- a/spring-boot-samples/spring-boot-sample-web-secure-custom/src/main/resources/templates/home.html +++ b/spring-boot-samples/spring-boot-sample-web-secure-custom/src/main/resources/templates/home.html @@ -13,7 +13,6 @@ Plain @@ -21,6 +20,9 @@
Fake content
July 11, 2012 2:17:16 PM CDT
+
+ +
diff --git a/spring-boot-samples/spring-boot-sample-web-secure-jdbc/src/main/java/sample/web/secure/jdbc/SampleWebSecureCustomApplication.java b/spring-boot-samples/spring-boot-sample-web-secure-jdbc/src/main/java/sample/web/secure/jdbc/SampleWebSecureCustomApplication.java index 7ab9f81460..ae5f6910da 100644 --- a/spring-boot-samples/spring-boot-sample-web-secure-jdbc/src/main/java/sample/web/secure/jdbc/SampleWebSecureCustomApplication.java +++ b/spring-boot-samples/spring-boot-sample-web-secure-jdbc/src/main/java/sample/web/secure/jdbc/SampleWebSecureCustomApplication.java @@ -81,7 +81,7 @@ public class SampleWebSecureCustomApplication extends WebMvcConfigurerAdapter { protected void configure(HttpSecurity http) throws Exception { http.authorizeRequests().antMatchers("/css/**").permitAll().anyRequest() .fullyAuthenticated().and().formLogin().loginPage("/login") - .failureUrl("/login?error").permitAll(); + .failureUrl("/login?error").permitAll().and().logout().permitAll(); } @Override diff --git a/spring-boot-samples/spring-boot-sample-web-secure-jdbc/src/main/resources/templates/home.html b/spring-boot-samples/spring-boot-sample-web-secure-jdbc/src/main/resources/templates/home.html index 6fa69dc027..024fee0209 100644 --- a/spring-boot-samples/spring-boot-sample-web-secure-jdbc/src/main/resources/templates/home.html +++ b/spring-boot-samples/spring-boot-sample-web-secure-jdbc/src/main/resources/templates/home.html @@ -13,7 +13,6 @@ Plain @@ -21,6 +20,9 @@
Fake content
July 11, 2012 2:17:16 PM CDT
+
+ +
diff --git a/spring-boot-samples/spring-boot-sample-web-secure/src/main/java/sample/web/secure/SampleWebSecureApplication.java b/spring-boot-samples/spring-boot-sample-web-secure/src/main/java/sample/web/secure/SampleWebSecureApplication.java index 8bbc13b4ee..a05d0cbf02 100644 --- a/spring-boot-samples/spring-boot-sample-web-secure/src/main/java/sample/web/secure/SampleWebSecureApplication.java +++ b/spring-boot-samples/spring-boot-sample-web-secure/src/main/java/sample/web/secure/SampleWebSecureApplication.java @@ -71,7 +71,8 @@ public class SampleWebSecureApplication extends WebMvcConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { http.authorizeRequests().anyRequest().fullyAuthenticated().and().formLogin() - .loginPage("/login").failureUrl("/login?error").permitAll(); + .loginPage("/login").failureUrl("/login?error").permitAll().and() + .logout().permitAll(); } @Override diff --git a/spring-boot-samples/spring-boot-sample-web-secure/src/main/resources/templates/home.html b/spring-boot-samples/spring-boot-sample-web-secure/src/main/resources/templates/home.html index 6fa69dc027..024fee0209 100644 --- a/spring-boot-samples/spring-boot-sample-web-secure/src/main/resources/templates/home.html +++ b/spring-boot-samples/spring-boot-sample-web-secure/src/main/resources/templates/home.html @@ -13,7 +13,6 @@ Plain @@ -21,6 +20,9 @@
Fake content
July 11, 2012 2:17:16 PM CDT
+
+ +