码迷,mamicode.com
首页 > 编程语言 > 详细

SpringBoot2.x集成springSecurity和OAuth2.0启动错误处理

时间:2021-06-02 14:05:33      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:defining   proc   could not   nis   point   process   ini   cti   jar   

当启用@EnableAuthorizationServer注解时,启动项目报错

报错信息

Description:


Field configurers in org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerSecurityConfiguration required a bean of type java.util.List that could not be found.


The injection point has the following annotations:
    - @org.springframework.beans.factory.annotation.Value(value=#{@autowiredWebSecurityConfigurersIgnoreParents.getWebSecurityConfigurers()})

Action:

Consider defining a bean of type java.util.List in your configuration.


Process finished with exit code 1

 

因为SpringBoot2.x已经将 security.oauth2的自动配置类spring-boot-autoconfigure的jar中移除。

如OauthAuthorizationServerConfiguration.java配置类在spring-boot-autoconfigure-1.3.5.RELEASE.jar中还是存在的
解决方法
添加maven依赖
<dependency>
    <groupId>org.springframework.security.oauth.boot</groupId>
    <artifactId>spring-security-oauth2-autoconfigure</artifactId>
    <version>2.0.0.RELEASE</version>
</dependency>

 

SpringBoot2.x集成springSecurity,OAuth2.0的完整maven依赖

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-security</artifactId>
    <version>2.2.3.RELEASE</version>
</dependency>
<dependency>
    <groupId>org.springframework.security.oauth</groupId>
    <artifactId>spring-security-oauth2</artifactId>
    <version>2.2.1.RELEASE</version>
</dependency>
<dependency>
    <groupId>org.springframework.security.oauth.boot</groupId>
    <artifactId>spring-security-oauth2-autoconfigure</artifactId>
    <version>2.0.0.RELEASE</version>
</dependency>

 

SpringBoot2.x集成springSecurity和OAuth2.0启动错误处理

标签:defining   proc   could not   nis   point   process   ini   cti   jar   

原文地址:https://www.cnblogs.com/gne-hwz/p/14820998.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!