From 143aff917b4e0a888f861278f2c683dbb5560da5 Mon Sep 17 00:00:00 2001 From: Loredana Date: Sun, 4 Aug 2019 13:37:14 +0300 Subject: [PATCH] remove obsolete modules; appears to be from issue BAEL-119 which was not published --- pom.xml | 6 -- spring-security-client/README.MD | 11 --- spring-security-client/pom.xml | 25 ------ .../pom.xml | 47 ---------- .../java/org/baeldung/config/Application.java | 21 ----- .../java/org/baeldung/config/MvcConfig.java | 23 ----- .../org/baeldung/config/SecurityConfig.java | 40 --------- .../src/main/resources/application.properties | 3 - .../src/main/resources/logback.xml | 13 --- .../src/main/webapp/WEB-INF/jsp/index.jsp | 24 ----- .../SpringContextIntegrationTest.java | 16 ---- .../java/org/baeldung/SpringContextTest.java | 16 ---- .../spring-security-jsp-authorize/pom.xml | 47 ---------- .../java/org/baeldung/config/Application.java | 21 ----- .../java/org/baeldung/config/MvcConfig.java | 23 ----- .../org/baeldung/config/SecurityConfig.java | 40 --------- .../src/main/resources/application.properties | 3 - .../src/main/resources/logback.xml | 13 --- .../src/main/webapp/WEB-INF/jsp/index.jsp | 33 ------- .../SpringContextIntegrationTest.java | 16 ---- .../java/org/baeldung/SpringContextTest.java | 16 ---- .../spring-security-jsp-config/pom.xml | 47 ---------- .../java/org/baeldung/config/Application.java | 21 ----- .../java/org/baeldung/config/MvcConfig.java | 23 ----- .../org/baeldung/config/SecurityConfig.java | 40 --------- .../src/main/resources/application.properties | 3 - .../src/main/resources/logback.xml | 13 --- .../src/main/webapp/WEB-INF/jsp/index.jsp | 21 ----- .../SpringContextIntegrationTest.java | 16 ---- .../java/org/baeldung/SpringContextTest.java | 16 ---- .../spring-security-mvc/pom.xml | 30 ------- .../java/org/baeldung/config/Application.java | 20 ----- .../org/baeldung/config/SecurityConfig.java | 40 --------- .../src/main/resources/application.properties | 1 - .../src/main/resources/logback.xml | 13 --- .../SpringContextIntegrationTest.java | 16 ---- .../java/org/baeldung/SpringContextTest.java | 16 ---- .../pom.xml | 43 --------- .../java/org/baeldung/config/Application.java | 14 --- .../java/org/baeldung/config/MvcConfig.java | 44 --------- .../org/baeldung/config/MvcConfigManual.java | 22 ----- .../config/RegistrationController.java | 89 ------------------- .../org/baeldung/config/SecurityConfig.java | 42 --------- .../config/WebSecurityConfigManual.java | 35 -------- .../src/main/resources/application.properties | 1 - .../src/main/resources/logback.xml | 13 --- .../src/main/resources/templates/hello.html | 15 ---- .../src/main/resources/templates/home.html | 15 ---- .../src/main/resources/templates/index.html | 23 ----- .../src/main/resources/templates/login.html | 21 ----- .../templates/registrationError.html | 1 - .../templates/registrationSuccess.html | 15 ---- .../SpringContextIntegrationTest.java | 16 ---- .../java/org/baeldung/SpringContextTest.java | 16 ---- .../pom.xml | 43 --------- .../java/org/baeldung/config/Application.java | 14 --- .../java/org/baeldung/config/MvcConfig.java | 42 --------- .../org/baeldung/config/SecurityConfig.java | 40 --------- .../src/main/resources/application.properties | 1 - .../src/main/resources/logback.xml | 13 --- .../src/main/resources/templates/index.html | 32 ------- .../SpringContextIntegrationTest.java | 16 ---- .../java/org/baeldung/SpringContextTest.java | 16 ---- .../spring-security-thymeleaf-config/pom.xml | 42 --------- .../java/org/baeldung/config/Application.java | 14 --- .../java/org/baeldung/config/MvcConfig.java | 42 --------- .../org/baeldung/config/SecurityConfig.java | 40 --------- .../src/main/resources/application.properties | 1 - .../src/main/resources/logback.xml | 13 --- .../src/main/resources/templates/index.html | 21 ----- .../SpringContextIntegrationTest.java | 16 ---- .../java/org/baeldung/SpringContextTest.java | 16 ---- 72 files changed, 1640 deletions(-) delete mode 100644 spring-security-client/README.MD delete mode 100644 spring-security-client/pom.xml delete mode 100644 spring-security-client/spring-security-jsp-authentication/pom.xml delete mode 100644 spring-security-client/spring-security-jsp-authentication/src/main/java/org/baeldung/config/Application.java delete mode 100644 spring-security-client/spring-security-jsp-authentication/src/main/java/org/baeldung/config/MvcConfig.java delete mode 100644 spring-security-client/spring-security-jsp-authentication/src/main/java/org/baeldung/config/SecurityConfig.java delete mode 100644 spring-security-client/spring-security-jsp-authentication/src/main/resources/application.properties delete mode 100644 spring-security-client/spring-security-jsp-authentication/src/main/resources/logback.xml delete mode 100644 spring-security-client/spring-security-jsp-authentication/src/main/webapp/WEB-INF/jsp/index.jsp delete mode 100644 spring-security-client/spring-security-jsp-authentication/src/test/java/org/baeldung/SpringContextIntegrationTest.java delete mode 100644 spring-security-client/spring-security-jsp-authentication/src/test/java/org/baeldung/SpringContextTest.java delete mode 100644 spring-security-client/spring-security-jsp-authorize/pom.xml delete mode 100644 spring-security-client/spring-security-jsp-authorize/src/main/java/org/baeldung/config/Application.java delete mode 100644 spring-security-client/spring-security-jsp-authorize/src/main/java/org/baeldung/config/MvcConfig.java delete mode 100644 spring-security-client/spring-security-jsp-authorize/src/main/java/org/baeldung/config/SecurityConfig.java delete mode 100644 spring-security-client/spring-security-jsp-authorize/src/main/resources/application.properties delete mode 100644 spring-security-client/spring-security-jsp-authorize/src/main/resources/logback.xml delete mode 100644 spring-security-client/spring-security-jsp-authorize/src/main/webapp/WEB-INF/jsp/index.jsp delete mode 100644 spring-security-client/spring-security-jsp-authorize/src/test/java/org/baeldung/SpringContextIntegrationTest.java delete mode 100644 spring-security-client/spring-security-jsp-authorize/src/test/java/org/baeldung/SpringContextTest.java delete mode 100644 spring-security-client/spring-security-jsp-config/pom.xml delete mode 100644 spring-security-client/spring-security-jsp-config/src/main/java/org/baeldung/config/Application.java delete mode 100644 spring-security-client/spring-security-jsp-config/src/main/java/org/baeldung/config/MvcConfig.java delete mode 100644 spring-security-client/spring-security-jsp-config/src/main/java/org/baeldung/config/SecurityConfig.java delete mode 100644 spring-security-client/spring-security-jsp-config/src/main/resources/application.properties delete mode 100644 spring-security-client/spring-security-jsp-config/src/main/resources/logback.xml delete mode 100644 spring-security-client/spring-security-jsp-config/src/main/webapp/WEB-INF/jsp/index.jsp delete mode 100644 spring-security-client/spring-security-jsp-config/src/test/java/org/baeldung/SpringContextIntegrationTest.java delete mode 100644 spring-security-client/spring-security-jsp-config/src/test/java/org/baeldung/SpringContextTest.java delete mode 100644 spring-security-client/spring-security-mvc/pom.xml delete mode 100644 spring-security-client/spring-security-mvc/src/main/java/org/baeldung/config/Application.java delete mode 100644 spring-security-client/spring-security-mvc/src/main/java/org/baeldung/config/SecurityConfig.java delete mode 100644 spring-security-client/spring-security-mvc/src/main/resources/application.properties delete mode 100644 spring-security-client/spring-security-mvc/src/main/resources/logback.xml delete mode 100644 spring-security-client/spring-security-mvc/src/test/java/org/baeldung/SpringContextIntegrationTest.java delete mode 100644 spring-security-client/spring-security-mvc/src/test/java/org/baeldung/SpringContextTest.java delete mode 100644 spring-security-client/spring-security-thymeleaf-authentication/pom.xml delete mode 100644 spring-security-client/spring-security-thymeleaf-authentication/src/main/java/org/baeldung/config/Application.java delete mode 100644 spring-security-client/spring-security-thymeleaf-authentication/src/main/java/org/baeldung/config/MvcConfig.java delete mode 100644 spring-security-client/spring-security-thymeleaf-authentication/src/main/java/org/baeldung/config/MvcConfigManual.java delete mode 100644 spring-security-client/spring-security-thymeleaf-authentication/src/main/java/org/baeldung/config/RegistrationController.java delete mode 100644 spring-security-client/spring-security-thymeleaf-authentication/src/main/java/org/baeldung/config/SecurityConfig.java delete mode 100644 spring-security-client/spring-security-thymeleaf-authentication/src/main/java/org/baeldung/config/WebSecurityConfigManual.java delete mode 100644 spring-security-client/spring-security-thymeleaf-authentication/src/main/resources/application.properties delete mode 100644 spring-security-client/spring-security-thymeleaf-authentication/src/main/resources/logback.xml delete mode 100644 spring-security-client/spring-security-thymeleaf-authentication/src/main/resources/templates/hello.html delete mode 100644 spring-security-client/spring-security-thymeleaf-authentication/src/main/resources/templates/home.html delete mode 100644 spring-security-client/spring-security-thymeleaf-authentication/src/main/resources/templates/index.html delete mode 100644 spring-security-client/spring-security-thymeleaf-authentication/src/main/resources/templates/login.html delete mode 100644 spring-security-client/spring-security-thymeleaf-authentication/src/main/resources/templates/registrationError.html delete mode 100644 spring-security-client/spring-security-thymeleaf-authentication/src/main/resources/templates/registrationSuccess.html delete mode 100644 spring-security-client/spring-security-thymeleaf-authentication/src/test/java/org/baeldung/SpringContextIntegrationTest.java delete mode 100644 spring-security-client/spring-security-thymeleaf-authentication/src/test/java/org/baeldung/SpringContextTest.java delete mode 100644 spring-security-client/spring-security-thymeleaf-authorize/pom.xml delete mode 100644 spring-security-client/spring-security-thymeleaf-authorize/src/main/java/org/baeldung/config/Application.java delete mode 100644 spring-security-client/spring-security-thymeleaf-authorize/src/main/java/org/baeldung/config/MvcConfig.java delete mode 100644 spring-security-client/spring-security-thymeleaf-authorize/src/main/java/org/baeldung/config/SecurityConfig.java delete mode 100644 spring-security-client/spring-security-thymeleaf-authorize/src/main/resources/application.properties delete mode 100644 spring-security-client/spring-security-thymeleaf-authorize/src/main/resources/logback.xml delete mode 100644 spring-security-client/spring-security-thymeleaf-authorize/src/main/resources/templates/index.html delete mode 100644 spring-security-client/spring-security-thymeleaf-authorize/src/test/java/org/baeldung/SpringContextIntegrationTest.java delete mode 100644 spring-security-client/spring-security-thymeleaf-authorize/src/test/java/org/baeldung/SpringContextTest.java delete mode 100644 spring-security-client/spring-security-thymeleaf-config/pom.xml delete mode 100644 spring-security-client/spring-security-thymeleaf-config/src/main/java/org/baeldung/config/Application.java delete mode 100644 spring-security-client/spring-security-thymeleaf-config/src/main/java/org/baeldung/config/MvcConfig.java delete mode 100644 spring-security-client/spring-security-thymeleaf-config/src/main/java/org/baeldung/config/SecurityConfig.java delete mode 100644 spring-security-client/spring-security-thymeleaf-config/src/main/resources/application.properties delete mode 100644 spring-security-client/spring-security-thymeleaf-config/src/main/resources/logback.xml delete mode 100644 spring-security-client/spring-security-thymeleaf-config/src/main/resources/templates/index.html delete mode 100644 spring-security-client/spring-security-thymeleaf-config/src/test/java/org/baeldung/SpringContextIntegrationTest.java delete mode 100644 spring-security-client/spring-security-thymeleaf-config/src/test/java/org/baeldung/SpringContextTest.java diff --git a/pom.xml b/pom.xml index 352da33fee..451b5b4961 100644 --- a/pom.xml +++ b/pom.xml @@ -731,8 +731,6 @@ spring-security-angular/server spring-security-cache-control - spring-security-client - spring-security-core spring-security-mvc-boot spring-security-mvc-custom @@ -910,7 +908,6 @@ spring-security-acl spring-security-angular spring-security-cache-control - spring-security-client spring-security-core spring-security-mvc-boot spring-security-mvc-custom @@ -1403,9 +1400,6 @@ spring-security-acl spring-security-angular/server spring-security-cache-control - - spring-security-client - spring-security-core spring-security-mvc-boot spring-security-mvc-custom diff --git a/spring-security-client/README.MD b/spring-security-client/README.MD deleted file mode 100644 index 0b0af7ffe1..0000000000 --- a/spring-security-client/README.MD +++ /dev/null @@ -1,11 +0,0 @@ -========= -## Spring Security Authentication/Authorization Example Project - -##The Course -The "REST With Spring" Classes: http://github.learnspringsecurity.com - -### Relevant Articles: -- [Spring Security Manual Authentication](http://www.baeldung.com/spring-security-authentication) - -### Build the Project -mvn clean install diff --git a/spring-security-client/pom.xml b/spring-security-client/pom.xml deleted file mode 100644 index 96ac837a09..0000000000 --- a/spring-security-client/pom.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - 4.0.0 - spring-security-client - spring-security-client - pom - - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - .. - - - - spring-security-jsp-authentication - spring-security-jsp-authorize - spring-security-jsp-config - spring-security-mvc - spring-security-thymeleaf-authentication - spring-security-thymeleaf-authorize - spring-security-thymeleaf-config - - diff --git a/spring-security-client/spring-security-jsp-authentication/pom.xml b/spring-security-client/spring-security-jsp-authentication/pom.xml deleted file mode 100644 index 9cb2a45331..0000000000 --- a/spring-security-client/spring-security-jsp-authentication/pom.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - 4.0.0 - com.baeldung - spring-security-jsp-authentication - 0.0.1-SNAPSHOT - spring-security-jsp-authentication - war - Spring Security JSP Authentication tag sample - - - parent-boot-1 - com.baeldung - 0.0.1-SNAPSHOT - ../../parent-boot-1 - - - - - org.springframework.boot - spring-boot-starter-security - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-tomcat - - - org.apache.tomcat.embed - tomcat-embed-jasper - provided - - - javax.servlet - jstl - - - org.springframework.security - spring-security-taglibs - - - - diff --git a/spring-security-client/spring-security-jsp-authentication/src/main/java/org/baeldung/config/Application.java b/spring-security-client/spring-security-jsp-authentication/src/main/java/org/baeldung/config/Application.java deleted file mode 100644 index c2c5939676..0000000000 --- a/spring-security-client/spring-security-jsp-authentication/src/main/java/org/baeldung/config/Application.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.baeldung.config; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; -import org.springframework.boot.builder.SpringApplicationBuilder; -import org.springframework.boot.web.support.SpringBootServletInitializer; - -@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class }) -public class Application extends SpringBootServletInitializer { - - @Override - protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { - return application.sources(Application.class); - } - - public static void main(String[] args) { - SpringApplication.run(Application.class, args); - } - -} diff --git a/spring-security-client/spring-security-jsp-authentication/src/main/java/org/baeldung/config/MvcConfig.java b/spring-security-client/spring-security-jsp-authentication/src/main/java/org/baeldung/config/MvcConfig.java deleted file mode 100644 index fa2a324146..0000000000 --- a/spring-security-client/spring-security-jsp-authentication/src/main/java/org/baeldung/config/MvcConfig.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.baeldung.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; - -@Configuration -public class MvcConfig extends WebMvcConfigurerAdapter { - - public MvcConfig() { - super(); - } - - // - - @Override - public void addViewControllers(final ViewControllerRegistry registry) { - super.addViewControllers(registry); - registry.addViewController("/").setViewName("forward:/index"); - registry.addViewController("/index"); - } - -} \ No newline at end of file diff --git a/spring-security-client/spring-security-jsp-authentication/src/main/java/org/baeldung/config/SecurityConfig.java b/spring-security-client/spring-security-jsp-authentication/src/main/java/org/baeldung/config/SecurityConfig.java deleted file mode 100644 index bd6c56d38a..0000000000 --- a/spring-security-client/spring-security-jsp-authentication/src/main/java/org/baeldung/config/SecurityConfig.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.baeldung.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; -import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.config.annotation.web.builders.WebSecurity; -import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; -import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; - -@Configuration -@EnableWebSecurity -public class SecurityConfig extends WebSecurityConfigurerAdapter { - - @Override - protected void configure(final AuthenticationManagerBuilder auth) throws Exception { - // @formatter:off - auth.inMemoryAuthentication() - .withUser("john").password("123").roles("USER") - .and() - .withUser("tom").password("111").roles("ADMIN"); - // @formatter:on - } - - @Override - public void configure(WebSecurity web) throws Exception { - web.ignoring().antMatchers("/resources/**"); - } - - @Override - protected void configure(final HttpSecurity http) throws Exception { - // @formatter:off - http.authorizeRequests() - .antMatchers("/login").permitAll() - .antMatchers("/admin").hasRole("ADMIN") - .anyRequest().authenticated() - .and().formLogin().permitAll() - ; - // @formatter:on - } -} \ No newline at end of file diff --git a/spring-security-client/spring-security-jsp-authentication/src/main/resources/application.properties b/spring-security-client/spring-security-jsp-authentication/src/main/resources/application.properties deleted file mode 100644 index 26a80c79f3..0000000000 --- a/spring-security-client/spring-security-jsp-authentication/src/main/resources/application.properties +++ /dev/null @@ -1,3 +0,0 @@ -server.port: 8081 -spring.mvc.view.prefix: /WEB-INF/jsp/ -spring.mvc.view.suffix: .jsp \ No newline at end of file diff --git a/spring-security-client/spring-security-jsp-authentication/src/main/resources/logback.xml b/spring-security-client/spring-security-jsp-authentication/src/main/resources/logback.xml deleted file mode 100644 index 7d900d8ea8..0000000000 --- a/spring-security-client/spring-security-jsp-authentication/src/main/resources/logback.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - - - - - - - - \ No newline at end of file diff --git a/spring-security-client/spring-security-jsp-authentication/src/main/webapp/WEB-INF/jsp/index.jsp b/spring-security-client/spring-security-jsp-authentication/src/main/webapp/WEB-INF/jsp/index.jsp deleted file mode 100644 index 90c00e980a..0000000000 --- a/spring-security-client/spring-security-jsp-authentication/src/main/webapp/WEB-INF/jsp/index.jsp +++ /dev/null @@ -1,24 +0,0 @@ - <%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %> - - - - -Spring Security JSP Authorize - - - - - -
- Current user name: -
- Current user roles: -
- - \ No newline at end of file diff --git a/spring-security-client/spring-security-jsp-authentication/src/test/java/org/baeldung/SpringContextIntegrationTest.java b/spring-security-client/spring-security-jsp-authentication/src/test/java/org/baeldung/SpringContextIntegrationTest.java deleted file mode 100644 index 66243ef00d..0000000000 --- a/spring-security-client/spring-security-jsp-authentication/src/test/java/org/baeldung/SpringContextIntegrationTest.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.baeldung; - -import org.baeldung.config.Application; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest(classes = Application.class) -public class SpringContextIntegrationTest { - - @Test - public void whenSpringContextIsBootstrapped_thenNoExceptions() { - } -} diff --git a/spring-security-client/spring-security-jsp-authentication/src/test/java/org/baeldung/SpringContextTest.java b/spring-security-client/spring-security-jsp-authentication/src/test/java/org/baeldung/SpringContextTest.java deleted file mode 100644 index 0afb3899db..0000000000 --- a/spring-security-client/spring-security-jsp-authentication/src/test/java/org/baeldung/SpringContextTest.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.baeldung; - -import org.baeldung.config.Application; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest(classes = Application.class) -public class SpringContextTest { - - @Test - public void whenSpringContextIsBootstrapped_thenNoExceptions() { - } -} diff --git a/spring-security-client/spring-security-jsp-authorize/pom.xml b/spring-security-client/spring-security-jsp-authorize/pom.xml deleted file mode 100644 index ad4c9d105b..0000000000 --- a/spring-security-client/spring-security-jsp-authorize/pom.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - 4.0.0 - com.baeldung - spring-security-jsp-authorize - 0.0.1-SNAPSHOT - spring-security-jsp-authorize - Spring Security JSP Authorize tag sample - war - - - parent-boot-1 - com.baeldung - 0.0.1-SNAPSHOT - ../../parent-boot-1 - - - - - org.springframework.boot - spring-boot-starter-security - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-tomcat - - - org.apache.tomcat.embed - tomcat-embed-jasper - provided - - - javax.servlet - jstl - - - org.springframework.security - spring-security-taglibs - - - - diff --git a/spring-security-client/spring-security-jsp-authorize/src/main/java/org/baeldung/config/Application.java b/spring-security-client/spring-security-jsp-authorize/src/main/java/org/baeldung/config/Application.java deleted file mode 100644 index c2c5939676..0000000000 --- a/spring-security-client/spring-security-jsp-authorize/src/main/java/org/baeldung/config/Application.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.baeldung.config; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; -import org.springframework.boot.builder.SpringApplicationBuilder; -import org.springframework.boot.web.support.SpringBootServletInitializer; - -@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class }) -public class Application extends SpringBootServletInitializer { - - @Override - protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { - return application.sources(Application.class); - } - - public static void main(String[] args) { - SpringApplication.run(Application.class, args); - } - -} diff --git a/spring-security-client/spring-security-jsp-authorize/src/main/java/org/baeldung/config/MvcConfig.java b/spring-security-client/spring-security-jsp-authorize/src/main/java/org/baeldung/config/MvcConfig.java deleted file mode 100644 index fa2a324146..0000000000 --- a/spring-security-client/spring-security-jsp-authorize/src/main/java/org/baeldung/config/MvcConfig.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.baeldung.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; - -@Configuration -public class MvcConfig extends WebMvcConfigurerAdapter { - - public MvcConfig() { - super(); - } - - // - - @Override - public void addViewControllers(final ViewControllerRegistry registry) { - super.addViewControllers(registry); - registry.addViewController("/").setViewName("forward:/index"); - registry.addViewController("/index"); - } - -} \ No newline at end of file diff --git a/spring-security-client/spring-security-jsp-authorize/src/main/java/org/baeldung/config/SecurityConfig.java b/spring-security-client/spring-security-jsp-authorize/src/main/java/org/baeldung/config/SecurityConfig.java deleted file mode 100644 index bd6c56d38a..0000000000 --- a/spring-security-client/spring-security-jsp-authorize/src/main/java/org/baeldung/config/SecurityConfig.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.baeldung.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; -import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.config.annotation.web.builders.WebSecurity; -import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; -import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; - -@Configuration -@EnableWebSecurity -public class SecurityConfig extends WebSecurityConfigurerAdapter { - - @Override - protected void configure(final AuthenticationManagerBuilder auth) throws Exception { - // @formatter:off - auth.inMemoryAuthentication() - .withUser("john").password("123").roles("USER") - .and() - .withUser("tom").password("111").roles("ADMIN"); - // @formatter:on - } - - @Override - public void configure(WebSecurity web) throws Exception { - web.ignoring().antMatchers("/resources/**"); - } - - @Override - protected void configure(final HttpSecurity http) throws Exception { - // @formatter:off - http.authorizeRequests() - .antMatchers("/login").permitAll() - .antMatchers("/admin").hasRole("ADMIN") - .anyRequest().authenticated() - .and().formLogin().permitAll() - ; - // @formatter:on - } -} \ No newline at end of file diff --git a/spring-security-client/spring-security-jsp-authorize/src/main/resources/application.properties b/spring-security-client/spring-security-jsp-authorize/src/main/resources/application.properties deleted file mode 100644 index 26a80c79f3..0000000000 --- a/spring-security-client/spring-security-jsp-authorize/src/main/resources/application.properties +++ /dev/null @@ -1,3 +0,0 @@ -server.port: 8081 -spring.mvc.view.prefix: /WEB-INF/jsp/ -spring.mvc.view.suffix: .jsp \ No newline at end of file diff --git a/spring-security-client/spring-security-jsp-authorize/src/main/resources/logback.xml b/spring-security-client/spring-security-jsp-authorize/src/main/resources/logback.xml deleted file mode 100644 index 7d900d8ea8..0000000000 --- a/spring-security-client/spring-security-jsp-authorize/src/main/resources/logback.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - - - - - - - - \ No newline at end of file diff --git a/spring-security-client/spring-security-jsp-authorize/src/main/webapp/WEB-INF/jsp/index.jsp b/spring-security-client/spring-security-jsp-authorize/src/main/webapp/WEB-INF/jsp/index.jsp deleted file mode 100644 index 08af845bd4..0000000000 --- a/spring-security-client/spring-security-jsp-authorize/src/main/webapp/WEB-INF/jsp/index.jsp +++ /dev/null @@ -1,33 +0,0 @@ - <%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %> - - - - -Spring Security JSP Authorize - - - - - -
- - Only admins can see this message - - - - Only users can see this message - -
- - - Only users who can call "/admin" URL can see this message - -
- - \ No newline at end of file diff --git a/spring-security-client/spring-security-jsp-authorize/src/test/java/org/baeldung/SpringContextIntegrationTest.java b/spring-security-client/spring-security-jsp-authorize/src/test/java/org/baeldung/SpringContextIntegrationTest.java deleted file mode 100644 index 66243ef00d..0000000000 --- a/spring-security-client/spring-security-jsp-authorize/src/test/java/org/baeldung/SpringContextIntegrationTest.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.baeldung; - -import org.baeldung.config.Application; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest(classes = Application.class) -public class SpringContextIntegrationTest { - - @Test - public void whenSpringContextIsBootstrapped_thenNoExceptions() { - } -} diff --git a/spring-security-client/spring-security-jsp-authorize/src/test/java/org/baeldung/SpringContextTest.java b/spring-security-client/spring-security-jsp-authorize/src/test/java/org/baeldung/SpringContextTest.java deleted file mode 100644 index 0afb3899db..0000000000 --- a/spring-security-client/spring-security-jsp-authorize/src/test/java/org/baeldung/SpringContextTest.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.baeldung; - -import org.baeldung.config.Application; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest(classes = Application.class) -public class SpringContextTest { - - @Test - public void whenSpringContextIsBootstrapped_thenNoExceptions() { - } -} diff --git a/spring-security-client/spring-security-jsp-config/pom.xml b/spring-security-client/spring-security-jsp-config/pom.xml deleted file mode 100644 index 02ea206738..0000000000 --- a/spring-security-client/spring-security-jsp-config/pom.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - 4.0.0 - com.baeldung - spring-security-jsp-config - 0.0.1-SNAPSHOT - spring-security-jsp-config - Spring Security JSP configuration - war - - - parent-boot-1 - com.baeldung - 0.0.1-SNAPSHOT - ../../parent-boot-1 - - - - - org.springframework.boot - spring-boot-starter-security - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-tomcat - - - org.apache.tomcat.embed - tomcat-embed-jasper - provided - - - javax.servlet - jstl - - - org.springframework.security - spring-security-taglibs - - - - diff --git a/spring-security-client/spring-security-jsp-config/src/main/java/org/baeldung/config/Application.java b/spring-security-client/spring-security-jsp-config/src/main/java/org/baeldung/config/Application.java deleted file mode 100644 index c2c5939676..0000000000 --- a/spring-security-client/spring-security-jsp-config/src/main/java/org/baeldung/config/Application.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.baeldung.config; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; -import org.springframework.boot.builder.SpringApplicationBuilder; -import org.springframework.boot.web.support.SpringBootServletInitializer; - -@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class }) -public class Application extends SpringBootServletInitializer { - - @Override - protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { - return application.sources(Application.class); - } - - public static void main(String[] args) { - SpringApplication.run(Application.class, args); - } - -} diff --git a/spring-security-client/spring-security-jsp-config/src/main/java/org/baeldung/config/MvcConfig.java b/spring-security-client/spring-security-jsp-config/src/main/java/org/baeldung/config/MvcConfig.java deleted file mode 100644 index fa2a324146..0000000000 --- a/spring-security-client/spring-security-jsp-config/src/main/java/org/baeldung/config/MvcConfig.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.baeldung.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; - -@Configuration -public class MvcConfig extends WebMvcConfigurerAdapter { - - public MvcConfig() { - super(); - } - - // - - @Override - public void addViewControllers(final ViewControllerRegistry registry) { - super.addViewControllers(registry); - registry.addViewController("/").setViewName("forward:/index"); - registry.addViewController("/index"); - } - -} \ No newline at end of file diff --git a/spring-security-client/spring-security-jsp-config/src/main/java/org/baeldung/config/SecurityConfig.java b/spring-security-client/spring-security-jsp-config/src/main/java/org/baeldung/config/SecurityConfig.java deleted file mode 100644 index bd6c56d38a..0000000000 --- a/spring-security-client/spring-security-jsp-config/src/main/java/org/baeldung/config/SecurityConfig.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.baeldung.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; -import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.config.annotation.web.builders.WebSecurity; -import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; -import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; - -@Configuration -@EnableWebSecurity -public class SecurityConfig extends WebSecurityConfigurerAdapter { - - @Override - protected void configure(final AuthenticationManagerBuilder auth) throws Exception { - // @formatter:off - auth.inMemoryAuthentication() - .withUser("john").password("123").roles("USER") - .and() - .withUser("tom").password("111").roles("ADMIN"); - // @formatter:on - } - - @Override - public void configure(WebSecurity web) throws Exception { - web.ignoring().antMatchers("/resources/**"); - } - - @Override - protected void configure(final HttpSecurity http) throws Exception { - // @formatter:off - http.authorizeRequests() - .antMatchers("/login").permitAll() - .antMatchers("/admin").hasRole("ADMIN") - .anyRequest().authenticated() - .and().formLogin().permitAll() - ; - // @formatter:on - } -} \ No newline at end of file diff --git a/spring-security-client/spring-security-jsp-config/src/main/resources/application.properties b/spring-security-client/spring-security-jsp-config/src/main/resources/application.properties deleted file mode 100644 index 26a80c79f3..0000000000 --- a/spring-security-client/spring-security-jsp-config/src/main/resources/application.properties +++ /dev/null @@ -1,3 +0,0 @@ -server.port: 8081 -spring.mvc.view.prefix: /WEB-INF/jsp/ -spring.mvc.view.suffix: .jsp \ No newline at end of file diff --git a/spring-security-client/spring-security-jsp-config/src/main/resources/logback.xml b/spring-security-client/spring-security-jsp-config/src/main/resources/logback.xml deleted file mode 100644 index 7d900d8ea8..0000000000 --- a/spring-security-client/spring-security-jsp-config/src/main/resources/logback.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - - - - - - - - \ No newline at end of file diff --git a/spring-security-client/spring-security-jsp-config/src/main/webapp/WEB-INF/jsp/index.jsp b/spring-security-client/spring-security-jsp-config/src/main/webapp/WEB-INF/jsp/index.jsp deleted file mode 100644 index bd5ccb0c78..0000000000 --- a/spring-security-client/spring-security-jsp-config/src/main/webapp/WEB-INF/jsp/index.jsp +++ /dev/null @@ -1,21 +0,0 @@ - - - - -Spring Security JSP - - - - - -
- Welcome -
- - \ No newline at end of file diff --git a/spring-security-client/spring-security-jsp-config/src/test/java/org/baeldung/SpringContextIntegrationTest.java b/spring-security-client/spring-security-jsp-config/src/test/java/org/baeldung/SpringContextIntegrationTest.java deleted file mode 100644 index 66243ef00d..0000000000 --- a/spring-security-client/spring-security-jsp-config/src/test/java/org/baeldung/SpringContextIntegrationTest.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.baeldung; - -import org.baeldung.config.Application; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest(classes = Application.class) -public class SpringContextIntegrationTest { - - @Test - public void whenSpringContextIsBootstrapped_thenNoExceptions() { - } -} diff --git a/spring-security-client/spring-security-jsp-config/src/test/java/org/baeldung/SpringContextTest.java b/spring-security-client/spring-security-jsp-config/src/test/java/org/baeldung/SpringContextTest.java deleted file mode 100644 index 0afb3899db..0000000000 --- a/spring-security-client/spring-security-jsp-config/src/test/java/org/baeldung/SpringContextTest.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.baeldung; - -import org.baeldung.config.Application; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest(classes = Application.class) -public class SpringContextTest { - - @Test - public void whenSpringContextIsBootstrapped_thenNoExceptions() { - } -} diff --git a/spring-security-client/spring-security-mvc/pom.xml b/spring-security-client/spring-security-mvc/pom.xml deleted file mode 100644 index 75298026a8..0000000000 --- a/spring-security-client/spring-security-mvc/pom.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - 4.0.0 - com.baeldung - spring-security-mvc - 0.0.1-SNAPSHOT - spring-security-mvc - Spring Security MVC - war - - - parent-boot-1 - com.baeldung - 0.0.1-SNAPSHOT - ../../parent-boot-1 - - - - - org.springframework.boot - spring-boot-starter-security - - - org.springframework.boot - spring-boot-starter-web - - - - diff --git a/spring-security-client/spring-security-mvc/src/main/java/org/baeldung/config/Application.java b/spring-security-client/spring-security-mvc/src/main/java/org/baeldung/config/Application.java deleted file mode 100644 index 34c43fbe5a..0000000000 --- a/spring-security-client/spring-security-mvc/src/main/java/org/baeldung/config/Application.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.baeldung.config; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.builder.SpringApplicationBuilder; -import org.springframework.boot.web.support.SpringBootServletInitializer; - -@SpringBootApplication -public class Application extends SpringBootServletInitializer { - - @Override - protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { - return application.sources(Application.class); - } - - public static void main(String[] args) { - SpringApplication.run(Application.class, args); - } - -} diff --git a/spring-security-client/spring-security-mvc/src/main/java/org/baeldung/config/SecurityConfig.java b/spring-security-client/spring-security-mvc/src/main/java/org/baeldung/config/SecurityConfig.java deleted file mode 100644 index bd6c56d38a..0000000000 --- a/spring-security-client/spring-security-mvc/src/main/java/org/baeldung/config/SecurityConfig.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.baeldung.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; -import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.config.annotation.web.builders.WebSecurity; -import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; -import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; - -@Configuration -@EnableWebSecurity -public class SecurityConfig extends WebSecurityConfigurerAdapter { - - @Override - protected void configure(final AuthenticationManagerBuilder auth) throws Exception { - // @formatter:off - auth.inMemoryAuthentication() - .withUser("john").password("123").roles("USER") - .and() - .withUser("tom").password("111").roles("ADMIN"); - // @formatter:on - } - - @Override - public void configure(WebSecurity web) throws Exception { - web.ignoring().antMatchers("/resources/**"); - } - - @Override - protected void configure(final HttpSecurity http) throws Exception { - // @formatter:off - http.authorizeRequests() - .antMatchers("/login").permitAll() - .antMatchers("/admin").hasRole("ADMIN") - .anyRequest().authenticated() - .and().formLogin().permitAll() - ; - // @formatter:on - } -} \ No newline at end of file diff --git a/spring-security-client/spring-security-mvc/src/main/resources/application.properties b/spring-security-client/spring-security-mvc/src/main/resources/application.properties deleted file mode 100644 index c2eee0d931..0000000000 --- a/spring-security-client/spring-security-mvc/src/main/resources/application.properties +++ /dev/null @@ -1 +0,0 @@ -server.port: 8081 \ No newline at end of file diff --git a/spring-security-client/spring-security-mvc/src/main/resources/logback.xml b/spring-security-client/spring-security-mvc/src/main/resources/logback.xml deleted file mode 100644 index 7d900d8ea8..0000000000 --- a/spring-security-client/spring-security-mvc/src/main/resources/logback.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - - - - - - - - \ No newline at end of file diff --git a/spring-security-client/spring-security-mvc/src/test/java/org/baeldung/SpringContextIntegrationTest.java b/spring-security-client/spring-security-mvc/src/test/java/org/baeldung/SpringContextIntegrationTest.java deleted file mode 100644 index 66243ef00d..0000000000 --- a/spring-security-client/spring-security-mvc/src/test/java/org/baeldung/SpringContextIntegrationTest.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.baeldung; - -import org.baeldung.config.Application; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest(classes = Application.class) -public class SpringContextIntegrationTest { - - @Test - public void whenSpringContextIsBootstrapped_thenNoExceptions() { - } -} diff --git a/spring-security-client/spring-security-mvc/src/test/java/org/baeldung/SpringContextTest.java b/spring-security-client/spring-security-mvc/src/test/java/org/baeldung/SpringContextTest.java deleted file mode 100644 index 0afb3899db..0000000000 --- a/spring-security-client/spring-security-mvc/src/test/java/org/baeldung/SpringContextTest.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.baeldung; - -import org.baeldung.config.Application; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest(classes = Application.class) -public class SpringContextTest { - - @Test - public void whenSpringContextIsBootstrapped_thenNoExceptions() { - } -} diff --git a/spring-security-client/spring-security-thymeleaf-authentication/pom.xml b/spring-security-client/spring-security-thymeleaf-authentication/pom.xml deleted file mode 100644 index 01d2c6bdbe..0000000000 --- a/spring-security-client/spring-security-thymeleaf-authentication/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - 4.0.0 - - com.baeldung - spring-security-thymeleaf-authentication - 0.0.1-SNAPSHOT - spring-security-thymeleaf-authentication - Spring Security thymeleaf authentication tag sample - war - - - parent-boot-1 - com.baeldung - 0.0.1-SNAPSHOT - ../../parent-boot-1 - - - - - org.springframework.boot - spring-boot-starter-security - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-tomcat - - - org.springframework.boot - spring-boot-starter-thymeleaf - - - org.thymeleaf.extras - thymeleaf-extras-springsecurity4 - - - - diff --git a/spring-security-client/spring-security-thymeleaf-authentication/src/main/java/org/baeldung/config/Application.java b/spring-security-client/spring-security-thymeleaf-authentication/src/main/java/org/baeldung/config/Application.java deleted file mode 100644 index 329b104143..0000000000 --- a/spring-security-client/spring-security-thymeleaf-authentication/src/main/java/org/baeldung/config/Application.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.baeldung.config; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.web.support.SpringBootServletInitializer; - -@SpringBootApplication -public class Application extends SpringBootServletInitializer { - - public static void main(String[] args) { - SpringApplication.run(Application.class, args); - } - -} diff --git a/spring-security-client/spring-security-thymeleaf-authentication/src/main/java/org/baeldung/config/MvcConfig.java b/spring-security-client/spring-security-thymeleaf-authentication/src/main/java/org/baeldung/config/MvcConfig.java deleted file mode 100644 index 259433f6ae..0000000000 --- a/spring-security-client/spring-security-thymeleaf-authentication/src/main/java/org/baeldung/config/MvcConfig.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.baeldung.config; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; -import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer; -import org.springframework.web.servlet.config.annotation.EnableWebMvc; -import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; -import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; -import org.springframework.context.annotation.Profile; - -@Configuration -@EnableWebMvc -@Profile("!manual") -public class MvcConfig extends WebMvcConfigurerAdapter { - - public MvcConfig() { - super(); - } - - // - @Bean - public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() { - return new PropertySourcesPlaceholderConfigurer(); - } - - @Override - public void configureDefaultServletHandling(final DefaultServletHandlerConfigurer configurer) { - configurer.enable(); - } - - @Override - public void addViewControllers(final ViewControllerRegistry registry) { - super.addViewControllers(registry); - registry.addViewController("/").setViewName("forward:/index"); - registry.addViewController("/index"); - } - - @Override - public void addResourceHandlers(final ResourceHandlerRegistry registry) { - registry.addResourceHandler("/resources/**").addResourceLocations("/resources/"); - } -} \ No newline at end of file diff --git a/spring-security-client/spring-security-thymeleaf-authentication/src/main/java/org/baeldung/config/MvcConfigManual.java b/spring-security-client/spring-security-thymeleaf-authentication/src/main/java/org/baeldung/config/MvcConfigManual.java deleted file mode 100644 index d80527c30a..0000000000 --- a/spring-security-client/spring-security-thymeleaf-authentication/src/main/java/org/baeldung/config/MvcConfigManual.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.baeldung.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; -import org.springframework.web.servlet.config.annotation.EnableWebMvc; - -@Configuration -@EnableWebMvc -@Profile("manual") -public class MvcConfigManual extends WebMvcConfigurerAdapter { - - @Override - public void addViewControllers(ViewControllerRegistry registry) { - registry.addViewController("/home").setViewName("home"); - registry.addViewController("/").setViewName("home"); - registry.addViewController("/hello").setViewName("hello"); - registry.addViewController("/login").setViewName("login"); - } - -} diff --git a/spring-security-client/spring-security-thymeleaf-authentication/src/main/java/org/baeldung/config/RegistrationController.java b/spring-security-client/spring-security-thymeleaf-authentication/src/main/java/org/baeldung/config/RegistrationController.java deleted file mode 100644 index 2414ff9cac..0000000000 --- a/spring-security-client/spring-security-thymeleaf-authentication/src/main/java/org/baeldung/config/RegistrationController.java +++ /dev/null @@ -1,89 +0,0 @@ -package org.baeldung.config; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Profile; -import org.springframework.security.authentication.AbstractAuthenticationToken; -import org.springframework.security.authentication.AuthenticationManager; -import org.springframework.security.authentication.BadCredentialsException; -import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; -import org.springframework.security.core.Authentication; -import org.springframework.security.core.context.SecurityContextHolder; -import org.springframework.security.web.authentication.WebAuthenticationDetails; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * Manually authenticate a user using Spring Security / Spring Web MVC' (upon successful account registration) - * (http://stackoverflow.com/questions/4664893/how-to-manually-set-an-authenticated-user-in-spring-security-springmvc) - * - * @author jim clayson - */ -@Controller -@Profile("manual") -public class RegistrationController { - private static final Logger logger = LoggerFactory.getLogger(RegistrationController.class); - - @Autowired - private AuthenticationManager authenticationManager; - - /** - * For demo purposes this need only be a GET request method - * - * @param request - * @param response - * @return The view. Page confirming either successful registration (and/or - * successful authentication) or failed registration. - */ - @GetMapping("/register") - public String registerAndAuthenticate(HttpServletRequest request, HttpServletResponse response) { - logger.debug("registerAndAuthenticate: attempt to register, application should manually authenticate."); - - // Mocked values. Potentially could come from an HTML registration form, - // in which case this mapping would match on an HTTP POST, rather than a GET - String username = "user"; - String password = "password"; - - if (requestQualifiesForManualAuthentication()) { - try { - authenticate(username, password, request, response); - logger.debug("registerAndAuthenticate: authentication completed."); - } catch (BadCredentialsException bce) { - logger.debug("Authentication failure: bad credentials"); - bce.printStackTrace(); - return "systemError"; // assume a low-level error, since the registration - // form would have been successfully validated - } - } - - return "registrationSuccess"; - } - - private boolean requestQualifiesForManualAuthentication() { - // Some processing to determine that the user requires a Spring Security-recognized, - // application-directed login e.g. successful account registration. - return true; - } - - private void authenticate(String username, String password, HttpServletRequest request, HttpServletResponse response) throws BadCredentialsException { - logger.debug("attempting to authenticated, manually ... "); - - // create and populate the token - AbstractAuthenticationToken authToken = new UsernamePasswordAuthenticationToken(username, password); - authToken.setDetails(new WebAuthenticationDetails(request)); - - // This call returns an authentication object, which holds principle and user credentials - Authentication authentication = this.authenticationManager.authenticate(authToken); - - // The security context holds the authentication object, and is stored - // in thread local scope. - SecurityContextHolder.getContext().setAuthentication(authentication); - - logger.debug("User should now be authenticated."); - } - -} \ No newline at end of file diff --git a/spring-security-client/spring-security-thymeleaf-authentication/src/main/java/org/baeldung/config/SecurityConfig.java b/spring-security-client/spring-security-thymeleaf-authentication/src/main/java/org/baeldung/config/SecurityConfig.java deleted file mode 100644 index 153cc67661..0000000000 --- a/spring-security-client/spring-security-thymeleaf-authentication/src/main/java/org/baeldung/config/SecurityConfig.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.baeldung.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; -import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.config.annotation.web.builders.WebSecurity; -import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; -import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; -import org.springframework.context.annotation.Profile; - -@Configuration -@EnableWebSecurity -@Profile("!manual") -public class SecurityConfig extends WebSecurityConfigurerAdapter { - - @Override - protected void configure(final AuthenticationManagerBuilder auth) throws Exception { - // @formatter:off - auth.inMemoryAuthentication() - .withUser("john").password("123").roles("USER") - .and() - .withUser("tom").password("111").roles("ADMIN"); - // @formatter:on - } - - @Override - public void configure(WebSecurity web) throws Exception { - web.ignoring().antMatchers("/resources/**"); - } - - @Override - protected void configure(final HttpSecurity http) throws Exception { - // @formatter:off - http.authorizeRequests() - .antMatchers("/login").permitAll() - .antMatchers("/admin").hasRole("ADMIN") - .anyRequest().authenticated() - .and().formLogin().permitAll() - ; - // @formatter:on - } -} \ No newline at end of file diff --git a/spring-security-client/spring-security-thymeleaf-authentication/src/main/java/org/baeldung/config/WebSecurityConfigManual.java b/spring-security-client/spring-security-thymeleaf-authentication/src/main/java/org/baeldung/config/WebSecurityConfigManual.java deleted file mode 100644 index 180a53deba..0000000000 --- a/spring-security-client/spring-security-thymeleaf-authentication/src/main/java/org/baeldung/config/WebSecurityConfigManual.java +++ /dev/null @@ -1,35 +0,0 @@ -package org.baeldung.config; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; -import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; -import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; - -@Configuration -@EnableWebSecurity -@Profile("manual") -public class WebSecurityConfigManual extends WebSecurityConfigurerAdapter { - - @Override - protected void configure(HttpSecurity http) throws Exception { - // @formatter:off - http - .authorizeRequests() - .antMatchers("/", "/home", "/register").permitAll() - .anyRequest().authenticated() - .and() - .formLogin() - .loginPage("/login").permitAll() - .and() - .logout().permitAll(); - // @formatter:on - } - - @Autowired - public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception { - auth.inMemoryAuthentication().withUser("user").password("password").roles("USER"); - } -} diff --git a/spring-security-client/spring-security-thymeleaf-authentication/src/main/resources/application.properties b/spring-security-client/spring-security-thymeleaf-authentication/src/main/resources/application.properties deleted file mode 100644 index bafddced85..0000000000 --- a/spring-security-client/spring-security-thymeleaf-authentication/src/main/resources/application.properties +++ /dev/null @@ -1 +0,0 @@ -server.port=8081 \ No newline at end of file diff --git a/spring-security-client/spring-security-thymeleaf-authentication/src/main/resources/logback.xml b/spring-security-client/spring-security-thymeleaf-authentication/src/main/resources/logback.xml deleted file mode 100644 index 7d900d8ea8..0000000000 --- a/spring-security-client/spring-security-thymeleaf-authentication/src/main/resources/logback.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - - - - - - - - \ No newline at end of file diff --git a/spring-security-client/spring-security-thymeleaf-authentication/src/main/resources/templates/hello.html b/spring-security-client/spring-security-thymeleaf-authentication/src/main/resources/templates/hello.html deleted file mode 100644 index b37731b0ed..0000000000 --- a/spring-security-client/spring-security-thymeleaf-authentication/src/main/resources/templates/hello.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - Hello World! - - -

Hello [[${#httpServletRequest.remoteUser}]]!

-
- -
-

Click here to go to the home page.

- - - \ No newline at end of file diff --git a/spring-security-client/spring-security-thymeleaf-authentication/src/main/resources/templates/home.html b/spring-security-client/spring-security-thymeleaf-authentication/src/main/resources/templates/home.html deleted file mode 100644 index 6dbdf491c6..0000000000 --- a/spring-security-client/spring-security-thymeleaf-authentication/src/main/resources/templates/home.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - Spring Security Example - - -

Welcome!

- -

Click here to see a greeting.

-

Click here to send a dummy registration request, where the application logs you in.

- - \ No newline at end of file diff --git a/spring-security-client/spring-security-thymeleaf-authentication/src/main/resources/templates/index.html b/spring-security-client/spring-security-thymeleaf-authentication/src/main/resources/templates/index.html deleted file mode 100644 index c65b5f092b..0000000000 --- a/spring-security-client/spring-security-thymeleaf-authentication/src/main/resources/templates/index.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - -Spring Security Thymeleaf - - - - - -
- Current user name: Bob -
- Current user roles: [ROLE_USER, ROLE_ADMIN] -
- - \ No newline at end of file diff --git a/spring-security-client/spring-security-thymeleaf-authentication/src/main/resources/templates/login.html b/spring-security-client/spring-security-thymeleaf-authentication/src/main/resources/templates/login.html deleted file mode 100644 index 3f28efac69..0000000000 --- a/spring-security-client/spring-security-thymeleaf-authentication/src/main/resources/templates/login.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - Spring Security Example - - -
- Invalid username and password. -
-
- You have been logged out. -
-
-
-
-
-
-

Click here to go to the home page.

- - \ No newline at end of file diff --git a/spring-security-client/spring-security-thymeleaf-authentication/src/main/resources/templates/registrationError.html b/spring-security-client/spring-security-thymeleaf-authentication/src/main/resources/templates/registrationError.html deleted file mode 100644 index 756cc2390d..0000000000 --- a/spring-security-client/spring-security-thymeleaf-authentication/src/main/resources/templates/registrationError.html +++ /dev/null @@ -1 +0,0 @@ -Registration could not be completed at this time. Please try again later or contact support! \ No newline at end of file diff --git a/spring-security-client/spring-security-thymeleaf-authentication/src/main/resources/templates/registrationSuccess.html b/spring-security-client/spring-security-thymeleaf-authentication/src/main/resources/templates/registrationSuccess.html deleted file mode 100644 index b1c4336f2f..0000000000 --- a/spring-security-client/spring-security-thymeleaf-authentication/src/main/resources/templates/registrationSuccess.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - Registration Success! - - -

Registration succeeded. You have been logged in by the system. Welcome [[${#httpServletRequest.remoteUser}]]!

-
- -
-

Click here to go to the home page.

- - - \ No newline at end of file diff --git a/spring-security-client/spring-security-thymeleaf-authentication/src/test/java/org/baeldung/SpringContextIntegrationTest.java b/spring-security-client/spring-security-thymeleaf-authentication/src/test/java/org/baeldung/SpringContextIntegrationTest.java deleted file mode 100644 index 66243ef00d..0000000000 --- a/spring-security-client/spring-security-thymeleaf-authentication/src/test/java/org/baeldung/SpringContextIntegrationTest.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.baeldung; - -import org.baeldung.config.Application; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest(classes = Application.class) -public class SpringContextIntegrationTest { - - @Test - public void whenSpringContextIsBootstrapped_thenNoExceptions() { - } -} diff --git a/spring-security-client/spring-security-thymeleaf-authentication/src/test/java/org/baeldung/SpringContextTest.java b/spring-security-client/spring-security-thymeleaf-authentication/src/test/java/org/baeldung/SpringContextTest.java deleted file mode 100644 index 0afb3899db..0000000000 --- a/spring-security-client/spring-security-thymeleaf-authentication/src/test/java/org/baeldung/SpringContextTest.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.baeldung; - -import org.baeldung.config.Application; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest(classes = Application.class) -public class SpringContextTest { - - @Test - public void whenSpringContextIsBootstrapped_thenNoExceptions() { - } -} diff --git a/spring-security-client/spring-security-thymeleaf-authorize/pom.xml b/spring-security-client/spring-security-thymeleaf-authorize/pom.xml deleted file mode 100644 index 8c600c1f81..0000000000 --- a/spring-security-client/spring-security-thymeleaf-authorize/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - 4.0.0 - - com.baeldung - spring-security-thymeleaf-authorize - 0.0.1-SNAPSHOT - spring-security-thymeleaf-authorize - Spring Security thymeleaf authorize tag sample - war - - - parent-boot-1 - com.baeldung - 0.0.1-SNAPSHOT - ../../parent-boot-1 - - - - - org.springframework.boot - spring-boot-starter-security - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-tomcat - - - org.springframework.boot - spring-boot-starter-thymeleaf - - - org.thymeleaf.extras - thymeleaf-extras-springsecurity4 - - - - diff --git a/spring-security-client/spring-security-thymeleaf-authorize/src/main/java/org/baeldung/config/Application.java b/spring-security-client/spring-security-thymeleaf-authorize/src/main/java/org/baeldung/config/Application.java deleted file mode 100644 index 329b104143..0000000000 --- a/spring-security-client/spring-security-thymeleaf-authorize/src/main/java/org/baeldung/config/Application.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.baeldung.config; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.web.support.SpringBootServletInitializer; - -@SpringBootApplication -public class Application extends SpringBootServletInitializer { - - public static void main(String[] args) { - SpringApplication.run(Application.class, args); - } - -} diff --git a/spring-security-client/spring-security-thymeleaf-authorize/src/main/java/org/baeldung/config/MvcConfig.java b/spring-security-client/spring-security-thymeleaf-authorize/src/main/java/org/baeldung/config/MvcConfig.java deleted file mode 100644 index 9ade60e54c..0000000000 --- a/spring-security-client/spring-security-thymeleaf-authorize/src/main/java/org/baeldung/config/MvcConfig.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.baeldung.config; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; -import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer; -import org.springframework.web.servlet.config.annotation.EnableWebMvc; -import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; -import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; - -@Configuration -@EnableWebMvc -public class MvcConfig extends WebMvcConfigurerAdapter { - - public MvcConfig() { - super(); - } - - // - @Bean - public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() { - return new PropertySourcesPlaceholderConfigurer(); - } - - @Override - public void configureDefaultServletHandling(final DefaultServletHandlerConfigurer configurer) { - configurer.enable(); - } - - @Override - public void addViewControllers(final ViewControllerRegistry registry) { - super.addViewControllers(registry); - registry.addViewController("/").setViewName("forward:/index"); - registry.addViewController("/index"); - } - - @Override - public void addResourceHandlers(final ResourceHandlerRegistry registry) { - registry.addResourceHandler("/resources/**").addResourceLocations("/resources/"); - } -} \ No newline at end of file diff --git a/spring-security-client/spring-security-thymeleaf-authorize/src/main/java/org/baeldung/config/SecurityConfig.java b/spring-security-client/spring-security-thymeleaf-authorize/src/main/java/org/baeldung/config/SecurityConfig.java deleted file mode 100644 index bd6c56d38a..0000000000 --- a/spring-security-client/spring-security-thymeleaf-authorize/src/main/java/org/baeldung/config/SecurityConfig.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.baeldung.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; -import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.config.annotation.web.builders.WebSecurity; -import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; -import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; - -@Configuration -@EnableWebSecurity -public class SecurityConfig extends WebSecurityConfigurerAdapter { - - @Override - protected void configure(final AuthenticationManagerBuilder auth) throws Exception { - // @formatter:off - auth.inMemoryAuthentication() - .withUser("john").password("123").roles("USER") - .and() - .withUser("tom").password("111").roles("ADMIN"); - // @formatter:on - } - - @Override - public void configure(WebSecurity web) throws Exception { - web.ignoring().antMatchers("/resources/**"); - } - - @Override - protected void configure(final HttpSecurity http) throws Exception { - // @formatter:off - http.authorizeRequests() - .antMatchers("/login").permitAll() - .antMatchers("/admin").hasRole("ADMIN") - .anyRequest().authenticated() - .and().formLogin().permitAll() - ; - // @formatter:on - } -} \ No newline at end of file diff --git a/spring-security-client/spring-security-thymeleaf-authorize/src/main/resources/application.properties b/spring-security-client/spring-security-thymeleaf-authorize/src/main/resources/application.properties deleted file mode 100644 index bafddced85..0000000000 --- a/spring-security-client/spring-security-thymeleaf-authorize/src/main/resources/application.properties +++ /dev/null @@ -1 +0,0 @@ -server.port=8081 \ No newline at end of file diff --git a/spring-security-client/spring-security-thymeleaf-authorize/src/main/resources/logback.xml b/spring-security-client/spring-security-thymeleaf-authorize/src/main/resources/logback.xml deleted file mode 100644 index 7d900d8ea8..0000000000 --- a/spring-security-client/spring-security-thymeleaf-authorize/src/main/resources/logback.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - - - - - - - - \ No newline at end of file diff --git a/spring-security-client/spring-security-thymeleaf-authorize/src/main/resources/templates/index.html b/spring-security-client/spring-security-thymeleaf-authorize/src/main/resources/templates/index.html deleted file mode 100644 index fcbbfb4957..0000000000 --- a/spring-security-client/spring-security-thymeleaf-authorize/src/main/resources/templates/index.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - -Spring Security Thymeleaf - - - - - -
-
- Only admins can see this message -
- -
- Only users can see this message -
-
- -
- Only users who can call "/admin" URL can see this message -
-
- - \ No newline at end of file diff --git a/spring-security-client/spring-security-thymeleaf-authorize/src/test/java/org/baeldung/SpringContextIntegrationTest.java b/spring-security-client/spring-security-thymeleaf-authorize/src/test/java/org/baeldung/SpringContextIntegrationTest.java deleted file mode 100644 index 66243ef00d..0000000000 --- a/spring-security-client/spring-security-thymeleaf-authorize/src/test/java/org/baeldung/SpringContextIntegrationTest.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.baeldung; - -import org.baeldung.config.Application; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest(classes = Application.class) -public class SpringContextIntegrationTest { - - @Test - public void whenSpringContextIsBootstrapped_thenNoExceptions() { - } -} diff --git a/spring-security-client/spring-security-thymeleaf-authorize/src/test/java/org/baeldung/SpringContextTest.java b/spring-security-client/spring-security-thymeleaf-authorize/src/test/java/org/baeldung/SpringContextTest.java deleted file mode 100644 index 0afb3899db..0000000000 --- a/spring-security-client/spring-security-thymeleaf-authorize/src/test/java/org/baeldung/SpringContextTest.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.baeldung; - -import org.baeldung.config.Application; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest(classes = Application.class) -public class SpringContextTest { - - @Test - public void whenSpringContextIsBootstrapped_thenNoExceptions() { - } -} diff --git a/spring-security-client/spring-security-thymeleaf-config/pom.xml b/spring-security-client/spring-security-thymeleaf-config/pom.xml deleted file mode 100644 index aeda999405..0000000000 --- a/spring-security-client/spring-security-thymeleaf-config/pom.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - 4.0.0 - com.baeldung - spring-security-thymeleaf-config - 0.0.1-SNAPSHOT - spring-security-thymeleaf-config - Spring Security thymeleaf configuration sample project - war - - - parent-boot-1 - com.baeldung - 0.0.1-SNAPSHOT - ../../parent-boot-1 - - - - - org.springframework.boot - spring-boot-starter-security - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-tomcat - - - org.springframework.boot - spring-boot-starter-thymeleaf - - - org.thymeleaf.extras - thymeleaf-extras-springsecurity4 - - - - diff --git a/spring-security-client/spring-security-thymeleaf-config/src/main/java/org/baeldung/config/Application.java b/spring-security-client/spring-security-thymeleaf-config/src/main/java/org/baeldung/config/Application.java deleted file mode 100644 index 329b104143..0000000000 --- a/spring-security-client/spring-security-thymeleaf-config/src/main/java/org/baeldung/config/Application.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.baeldung.config; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.web.support.SpringBootServletInitializer; - -@SpringBootApplication -public class Application extends SpringBootServletInitializer { - - public static void main(String[] args) { - SpringApplication.run(Application.class, args); - } - -} diff --git a/spring-security-client/spring-security-thymeleaf-config/src/main/java/org/baeldung/config/MvcConfig.java b/spring-security-client/spring-security-thymeleaf-config/src/main/java/org/baeldung/config/MvcConfig.java deleted file mode 100644 index 9ade60e54c..0000000000 --- a/spring-security-client/spring-security-thymeleaf-config/src/main/java/org/baeldung/config/MvcConfig.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.baeldung.config; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; -import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer; -import org.springframework.web.servlet.config.annotation.EnableWebMvc; -import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; -import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; - -@Configuration -@EnableWebMvc -public class MvcConfig extends WebMvcConfigurerAdapter { - - public MvcConfig() { - super(); - } - - // - @Bean - public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() { - return new PropertySourcesPlaceholderConfigurer(); - } - - @Override - public void configureDefaultServletHandling(final DefaultServletHandlerConfigurer configurer) { - configurer.enable(); - } - - @Override - public void addViewControllers(final ViewControllerRegistry registry) { - super.addViewControllers(registry); - registry.addViewController("/").setViewName("forward:/index"); - registry.addViewController("/index"); - } - - @Override - public void addResourceHandlers(final ResourceHandlerRegistry registry) { - registry.addResourceHandler("/resources/**").addResourceLocations("/resources/"); - } -} \ No newline at end of file diff --git a/spring-security-client/spring-security-thymeleaf-config/src/main/java/org/baeldung/config/SecurityConfig.java b/spring-security-client/spring-security-thymeleaf-config/src/main/java/org/baeldung/config/SecurityConfig.java deleted file mode 100644 index bd6c56d38a..0000000000 --- a/spring-security-client/spring-security-thymeleaf-config/src/main/java/org/baeldung/config/SecurityConfig.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.baeldung.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; -import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.config.annotation.web.builders.WebSecurity; -import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; -import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; - -@Configuration -@EnableWebSecurity -public class SecurityConfig extends WebSecurityConfigurerAdapter { - - @Override - protected void configure(final AuthenticationManagerBuilder auth) throws Exception { - // @formatter:off - auth.inMemoryAuthentication() - .withUser("john").password("123").roles("USER") - .and() - .withUser("tom").password("111").roles("ADMIN"); - // @formatter:on - } - - @Override - public void configure(WebSecurity web) throws Exception { - web.ignoring().antMatchers("/resources/**"); - } - - @Override - protected void configure(final HttpSecurity http) throws Exception { - // @formatter:off - http.authorizeRequests() - .antMatchers("/login").permitAll() - .antMatchers("/admin").hasRole("ADMIN") - .anyRequest().authenticated() - .and().formLogin().permitAll() - ; - // @formatter:on - } -} \ No newline at end of file diff --git a/spring-security-client/spring-security-thymeleaf-config/src/main/resources/application.properties b/spring-security-client/spring-security-thymeleaf-config/src/main/resources/application.properties deleted file mode 100644 index bafddced85..0000000000 --- a/spring-security-client/spring-security-thymeleaf-config/src/main/resources/application.properties +++ /dev/null @@ -1 +0,0 @@ -server.port=8081 \ No newline at end of file diff --git a/spring-security-client/spring-security-thymeleaf-config/src/main/resources/logback.xml b/spring-security-client/spring-security-thymeleaf-config/src/main/resources/logback.xml deleted file mode 100644 index 7d900d8ea8..0000000000 --- a/spring-security-client/spring-security-thymeleaf-config/src/main/resources/logback.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - - - - - - - - \ No newline at end of file diff --git a/spring-security-client/spring-security-thymeleaf-config/src/main/resources/templates/index.html b/spring-security-client/spring-security-thymeleaf-config/src/main/resources/templates/index.html deleted file mode 100644 index 8e7394ad6a..0000000000 --- a/spring-security-client/spring-security-thymeleaf-config/src/main/resources/templates/index.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - -Spring Security Thymeleaf - - - - - -
- Welcome -
- - \ No newline at end of file diff --git a/spring-security-client/spring-security-thymeleaf-config/src/test/java/org/baeldung/SpringContextIntegrationTest.java b/spring-security-client/spring-security-thymeleaf-config/src/test/java/org/baeldung/SpringContextIntegrationTest.java deleted file mode 100644 index 66243ef00d..0000000000 --- a/spring-security-client/spring-security-thymeleaf-config/src/test/java/org/baeldung/SpringContextIntegrationTest.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.baeldung; - -import org.baeldung.config.Application; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest(classes = Application.class) -public class SpringContextIntegrationTest { - - @Test - public void whenSpringContextIsBootstrapped_thenNoExceptions() { - } -} diff --git a/spring-security-client/spring-security-thymeleaf-config/src/test/java/org/baeldung/SpringContextTest.java b/spring-security-client/spring-security-thymeleaf-config/src/test/java/org/baeldung/SpringContextTest.java deleted file mode 100644 index 0afb3899db..0000000000 --- a/spring-security-client/spring-security-thymeleaf-config/src/test/java/org/baeldung/SpringContextTest.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.baeldung; - -import org.baeldung.config.Application; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest(classes = Application.class) -public class SpringContextTest { - - @Test - public void whenSpringContextIsBootstrapped_thenNoExceptions() { - } -}