Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Why pass word encoding not working in Spring Boot

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.  

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

Seriously Rick? Seriously? You might as well just read this tiny ad:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic