认证授权中解决AuthenticationManager无法注入问题
认证授权中AuthenticationManager无法注入
在启动springboot项目时,提示AuthenticationManager无法注入问题

报如下错误
Description:
Field authenticationManager in com.security.uaa.config.AuthorizationServer required a bean of type 'org.springframework.security.authentication.AuthenticationManager' that could not be found.
The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)
解决方法
在继承 WebSecurityConfigurerAdapter 的类中配置

代码:
@Bean
@Override
public AuthenticationManager authenticationManagerBean() throws Exception {
return super.authenticationManagerBean();
}
总结
以上为个人经验,希望能给大家一个参考,也希望大家多多支持脚本之家。
相关文章
spring boot 3使用 elasticsearch 提供搜索建议的实例详解
这篇文章主要介绍了spring boot3使用elasticsearch提供搜索建议,本文通过实例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下2023-08-08
Struts2.5版本struts.xml与web.xml配置的更改方法
这篇文章主要给大家介绍了关于Struts2.5版本中struts.xm与web.xml配置的更改方法,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧2018-11-11


最新评论