I am using vaadin with spring boot and I try to incorporate the security of spring, I take an example and it works correctly with previous versions of spring boot and vaadin, but when updating the version, the same program gives me that error. In my project I have several added factors that complicate adding variables, after a lot of debugging I realize that if the example that works correctly with version 1.5.4.RELEASE of spring boot to change it to version 2.0.2.RELEASE I get the following error
Error Starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2018-05-28 21: 45: 30,700 ERROR 14282 --- [main] o.s.b.d.LoggingFailureAnalysisReporter:
APPLICATION FAILED TO START
Description:
Field authenticationManager in com.wordpress.kuylim.springbootvaadin.security.impl.SecurityImpl required a bean of type 'org.springframework.security.authentication.AuthenticationManager' that could not be found.
Action:
Consider defining a bean of type 'org.springframework.security.authentication.AuthenticationManager' in your configuration.
in the WebSecurityConfiguration class I have the following that as you will see is a basic example to be able to walk and collaborate all the members of the architecture without problems.
@Configuration @EnableWebSecurity public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter {
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth)
throws Exception {
auth.inMemoryAuthentication().withUser("user")
.password("123").roles("ADMIN");
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests()
.antMatchers("/THEME", "/VAADIN/**", "/PUSH/**", "/UIDL/**", "/login", "/error/**", "/accessDenied/**", "/vaadinServlet/**").permitAll()
.antMatchers("/admin").hasRole("ADMIN");
http.csrf().disable();
http.exceptionHandling().accessDeniedPage("/access-denied");
}
}
Obviously I could use this version of spring boot directly, but it is possible or very likely that this caused me problems in the other parts of the project.
This example is downloaded from KUYLIM. (You can see it in link ) and this is how it is generated, just changing the following from the pom
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.2.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
instead of what was originally
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.4.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
Thank you very much to anyone who can give me an example of how to solve this problem