首先我们需要知道AuthenticationManager是通过AuthenticationProvider做的认证操作 一、第一步实现AuthenticationProvider,在authenticate方法中编写验证的代码 二、第二步在配置类中设置指定的AuthenticationProvider实现类