diff --git a/spring-activiti/pom.xml b/spring-activiti/pom.xml
index ced1d74103..c0b13c7fff 100644
--- a/spring-activiti/pom.xml
+++ b/spring-activiti/pom.xml
@@ -10,11 +10,19 @@
com.baeldung
- parent-boot-2
+ parent-boot-3
0.0.1-SNAPSHOT
- ../parent-boot-2
+ ../parent-boot-3
+
+
+ alfresco
+ alfresco
+ https://artifacts.alfresco.com/nexus/content/repositories/public/
+
+
+
org.activiti
@@ -59,7 +67,7 @@
- 7.1.0.M6
+ 8.0.0
\ No newline at end of file
diff --git a/spring-activiti/src/main/java/com/baeldung/activiti/security/config/MvcConfig.java b/spring-activiti/src/main/java/com/baeldung/activiti/security/config/MvcConfig.java
index f9394742cd..f0c5e95ca5 100644
--- a/spring-activiti/src/main/java/com/baeldung/activiti/security/config/MvcConfig.java
+++ b/spring-activiti/src/main/java/com/baeldung/activiti/security/config/MvcConfig.java
@@ -3,11 +3,11 @@ package com.baeldung.activiti.security.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
@EnableWebMvc
-public class MvcConfig extends WebMvcConfigurerAdapter {
+public class MvcConfig implements WebMvcConfigurer {
@Override
public void addViewControllers(ViewControllerRegistry registry) {
diff --git a/spring-activiti/src/main/java/com/baeldung/activiti/security/withspring/SecurityConfig.java b/spring-activiti/src/main/java/com/baeldung/activiti/security/withspring/SecurityConfig.java
index 8dc3eee05e..6f3885a7ed 100644
--- a/spring-activiti/src/main/java/com/baeldung/activiti/security/withspring/SecurityConfig.java
+++ b/spring-activiti/src/main/java/com/baeldung/activiti/security/withspring/SecurityConfig.java
@@ -3,6 +3,7 @@ package com.baeldung.activiti.security.withspring;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
+import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
@@ -14,28 +15,25 @@ public class SecurityConfig {
@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
- http.antMatcher("/**")
- .authorizeRequests()
- .antMatchers("/protected-process*")
- .authenticated()
- .anyRequest()
- .permitAll()
- .and()
- .formLogin()
- .loginPage("/login")
- .defaultSuccessUrl("/homepage")
- .failureUrl("/login?error=true")
- .and()
- .csrf()
- .disable()
- .logout()
- .logoutSuccessUrl("/login");
+ http.authorizeHttpRequests(auth -> auth
+ .requestMatchers("/protected-process*")
+ .authenticated()
+ .anyRequest()
+ .permitAll())
+ .formLogin(login -> login
+ .loginPage("/login")
+ .defaultSuccessUrl("/homepage")
+ .failureUrl("/login?error=true")
+ .permitAll())
+ .csrf(AbstractHttpConfigurer::disable)
+ .logout(logout -> logout.logoutSuccessUrl("/login"));
return http.build();
}
@Bean
public UserDetailsService userDetailsService() {
- UserDetails user = User.withUsername("user")
+ User.UserBuilder users = User.withDefaultPasswordEncoder();
+ UserDetails user = users.username("user")
.password("{noop}pass")
.authorities("ROLE_ACTIVITI_USER")
.build();
diff --git a/spring-activiti/src/main/resources/templates/homepage.html b/spring-activiti/src/main/resources/templates/homepage.html
new file mode 100644
index 0000000000..68a7c42537
--- /dev/null
+++ b/spring-activiti/src/main/resources/templates/homepage.html
@@ -0,0 +1,6 @@
+
+
+
+Home page
+
+
\ No newline at end of file