1

I am new to JPA and Spring Boot.

http://www.baeldung.com/spring-security-registration-password-encoding-bcrypt

I'm looking to encode the password -- where would I place this bean -- do I just define it in my application.properties or in the pom.xml

The Old County
  • 89
  • 13
  • 59
  • 129

1 Answers1

0

Also you can define in your @Configuration beans, but is recommend to define password encoder in your @@EnableWebSecurity beans, it is automatically add @Configuration annotation for you and you can config more security related things.

@EnableWebSecurity
public class YourWebConfiguration extends WebSecurityConfigurerAdapter {

    @Autowired
    public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
        auth.userDetailsService(userDetailsService).passwordEncoder(new BCryptPasswordEncoder());
    }
}
Aaric Chen
  • 1,138
  • 11
  • 12