How to use new PasswordEncoder from Spring Security

前端 未结 4 967
走了就别回头了
走了就别回头了 2020-12-01 01:16

As of Spring Security 3.1.4.RELEASE, the old org.springframework.security.authentication.encoding.PasswordEncoder has been deprecated in favour of org.spr

4条回答
  •  醉话见心
    2020-12-01 01:55

    Here is the implementation of BCrypt which is working for me.

    in spring-security.xml

    
          
        
    
      
      
    
    
        
    

    In java class

    PasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
    String hashedPassword = passwordEncoder.encode(yourpassword);
    

    For more detailed example of spring security Click Here

    Hope this will help.

    Thanks

提交回复
热议问题