@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
auth.inMemoryAuthentication().withUser("abcde").password("123456").roles("USER");
}
and i am getting an error in the last line, it says that
The type org.springframework.security.authentication.AuthenticationManager cannot be resolved. It is indirectly referenced from required .class files
I have looked for a solution and cannot find a way to fix it.
Add spring-security-core to your build path. If you already have one, download the latest version.
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>5.0.0.RELEASE</version>
</dependency>
after mvn clean install , if you still see error in eclipse. refresh the project. This worked for me.
Add spring-security-core.jar to the Build Path of the project. If you are using Eclipse, right click on project --> Properties --> Java Build Path --> Libraries --> click Add jars or Add external jars and point to the jar file.
Also, do clean build.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With