認(rèn)證授權(quán)中解決AuthenticationManager無法注入問題
認(rèn)證授權(quán)中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(); }
總結(jié)
以上為個人經(jīng)驗,希望能給大家一個參考,也希望大家多多支持腳本之家。
相關(guān)文章
spring?boot?3使用?elasticsearch?提供搜索建議的實例詳解
這篇文章主要介紹了spring?boot3使用elasticsearch提供搜索建議,本文通過實例代碼給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下2023-08-08Struts2.5版本struts.xml與web.xml配置的更改方法
這篇文章主要給大家介紹了關(guān)于Struts2.5版本中struts.xm與web.xml配置的更改方法,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2018-11-11SpringBoot+MinIO實現(xiàn)對象存儲方式
這篇文章主要介紹了SpringBoot+MinIO實現(xiàn)對象存儲方式,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教2024-08-08Spring事務(wù)事件監(jiān)控的實現(xiàn)
這篇文章主要介紹了Spring事務(wù)事件監(jiān)控的實現(xiàn)。本文首先會使用實例進(jìn)行講解Spring事務(wù)事件是如何使用的,然后會講解這種使用方式的實現(xiàn)原理。感興趣的小伙伴們可以參考一下2018-10-10