• Post Reply Bookmark Topic Watch Topic
  • New Topic

Why pass word encoding not working in Spring Boot  RSS feed

 
Ajharul Abedeen
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to encode my password with BCryptPasswordEncoder or Md5PasswordEncoder. But any one is not working. Only plain password are working. Below i have given my code. I have tried both of them. Am i done anything wrong?
For Md5PasswordEncoder, i have used this link
  MD5 Hash Generetor to generate MD5 and then saved it database. 

        @Autowired
        public void configAuthentication(AuthenticationManagerBuilder auth) throws Exception
          {
              System.out.println("\n\n inside DataBase User Name Check..... \n\n");
            auth
                    .jdbcAuthentication()
                    .dataSource(dataSource)
                    .usersByUsernameQuery(" select name, pass, enable from usr where name = ?");
    //                .passwordEncoder(new Md5PasswordEncoder());
    //                .passwordEncoder(new BCryptPasswordEncoder());
    //                .authoritiesByUsernameQuery("select username, role from user_roles where username=?");
          }


 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!