使用jdbc身份验证的密码编码

时间:2018-10-25 14:05:37

标签: java spring-boot spring-security

node_modules具有AuthenticationManagerBuilder方法,该方法是JDBC身份验证的目标。作为使用它的示例

jdbcAuthentication()

问题:用户密码以编码形式保存在数据库中。在上述配置中(使用@Autowired public void configAuthentication(AuthenticationManagerBuilder auth) throws Exception { auth.jdbcAuthentication() .dataSource(dataSource) .usersByUsernameQuery( "select username,password, enabled from users where username=?" ) .authoritiesByUsernameQuery( "select username, role from user_roles where username=?"); } )是否可以通过任何方式设置要应用原始密码的编码器

注意:我已经解决了使用

将ui中的原始密码与存储在数据库中的编码密码进行匹配的问题。
AuthenticationManagerBuilder

并定义CustomUserDetailsS​​ervice userDetailsS​​ervice,CustomEncoder customEncoder,但我很好奇,如果没有这些自定义实现,是否可以重用AuthenticationManagerBuilder的功能

0 个答案:

没有答案