自定义 AuthenticationProvider ,UserDetailsService的实现类@Autowired 为null_auth.authenticationprovider().userdetailsservice()-CSDN博客

网站介绍:文章浏览阅读1.5k次。项目场景:整合spring security 自定义AuthenticationProvider 登录认证 签发token问题描述:在自定义 AuthenticationProvider 时 发现UserDetailsService 的实现类 UserService 一直注入不进去,为null自定义 AuthenticationProvider 通过 username直接登录package com.example.sso.provider;import com.example.sso.se_auth.authenticationprovider().userdetailsservice()