修改新验证条件下客户端无法登录bug,并去掉明文密码验证的登录代码
2个文件已修改
6 ■■■■■ 已修改文件
xboot-core/src/main/java/cn/exrick/xboot/core/config/security/DaoAuthenticationProvider.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
xboot-core/src/main/java/cn/exrick/xboot/core/config/security/WebSecurityConfig.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
xboot-core/src/main/java/cn/exrick/xboot/core/config/security/DaoAuthenticationProvider.java
@@ -24,8 +24,10 @@
            throw new BadCredentialsException("密码为空");
        }
        String password= authentication.getCredentials().toString();
        password = password.replace("\n","");
        password = Base64.decodeToString(password);
        if (!new BCryptPasswordEncoder().matches(password, userDetails.getPassword())) {
        boolean isPass = new BCryptPasswordEncoder().matches(password, userDetails.getPassword());
        if (!isPass) {
            throw new BadCredentialsException("密码错误");
        }
xboot-core/src/main/java/cn/exrick/xboot/core/config/security/WebSecurityConfig.java
@@ -82,7 +82,7 @@
    @Override
    protected void configure(AuthenticationManagerBuilder auth) throws Exception {
        auth.authenticationProvider(new DaoAuthenticationProvider());
        auth.userDetailsService(userDetailsService).passwordEncoder(new BCryptPasswordEncoder());
        //auth.userDetailsService(userDetailsService).passwordEncoder(new BCryptPasswordEncoder());
    }
    @Override