git clone --branch 4.自定义加密进行登录验证 git@gitee.com:simen_net/springboot-sample.git
使用bcprov-jdk18on的sm2加密算法对用户密码进行签名及认证
SM2_OBJ.verifyHex(rawPassword.toString(),encodedPassword,KeyUtils.STR_UUID)@GetMapping("/login")中将SPRING_SECURITY_LAST_EXCEPTION的错误消息注入login.ftlDaoAuthenticationProvider使用Sm2PasswordEncoder编码器、JwtUserDetailsService用户验证服务SM2_OBJ.signHex("123456", KeyUtils.STR_UUID)return new JwtUserDetails();public boolean matches(CharSequence rawPassword, String encodedPassword)
rawPassword或者encodedPassword为空,则throw new UsernameNotFoundException("用户不存在");throw new BadCredentialsException("账号密码验证失败")博主尝试通过gitee的发行版,使用Springboot为基础框架,逐步整合JWT、JPA、VUE等常用功能项目。【本节完成】使用bcprov-jdk18on的sm2加密算法对用户密码进行签名及认证
博主尝试通过gitee的发行版,使用Springboot为基础框架,逐步整合JWT、JPA、VUE等常用功能项目。 其中博主还将尝试统一异常处理、自定义加密认证、代码自动生成等功能
博主尝试通过gitee的发行版,使用Springboot为基础框架,逐步整合JWT、JPA、VUE等常用功能项目。【本节完成】KEY初始化功能和全局错误处理