Using Spring boot 2+ I have an application.properties file with the followings:
This is a part of my application.properties
:
spring.datasource.password={bcrypt}xxxxxxx
Without bcrypt the application works perfectly but using this, my code return error in DB JPA login.
I have added this to my security class:
@Autowired
private DataSource dataSource;
@Autowired
public void configAuthentication(AuthenticationManagerBuilder auth) throws Exception {
auth.jdbcAuthentication().dataSource(dataSource).passwordEncoder(passwordEncoder());
}
@Bean
public BCryptPasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
}
But it doesn’t solve my issue. still login failure to DB.
Can anyone help? Thanks in advance guys.