estoyEstoy desarrollando una aplicacion rapidaaplicación rápida donde tengo que activar la autenticacion miautenticación.
Mi configuracion del spring security es esta :
package com.grupocoder.peliculas.util;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import com.grupocoder.peliculas.Servicios.JpaUsuarioDetailServicio; import com.grupocoder.peliculas.auth.handler.LoginSuccessHandler;
public class SpringSecurityConfig {
package com.grupocoder.peliculas.util;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import com.grupocoder.peliculas.Servicios.JpaUsuarioDetailServicio;
import com.grupocoder.peliculas.auth.handler.LoginSuccessHandler;
public class SpringSecurityConfig {
@Autowired
private LoginSuccessHandler successHandler;
@Autowired
private JpaUsuarioDetailServicio userDetailsService;
@Bean
public BCryptPasswordEncoder bCryptPasswordEncoder() {
return new BCryptPasswordEncoder();
}
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests().antMatchers("/", "/css/**", "/js/**", "/images/**", "/listar").permitAll()
.anyRequest().authenticated().and().formLogin().successHandler(successHandler).loginPage("/login")
.permitAll().and().logout().permitAll().and().exceptionHandling().accessDeniedPage("/error_403");
}
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
System.out.println("USER DETAIL SERVICE"+userDetailsService);
auth.userDetailsService(userDetailsService).passwordEncoder(bCryptPasswordEncoder());
}
}
}
peroPero me marca este error :