認證授權中解決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();
}
總結
以上為個人經(jīng)驗,希望能給大家一個參考,也希望大家多多支持腳本之家。
相關文章
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
SpringBoot+MinIO實現(xiàn)對象存儲方式
這篇文章主要介紹了SpringBoot+MinIO實現(xiàn)對象存儲方式,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教2024-08-08

