【问题标题】:Oauth2 doesn't work in Spring BootOauth2 在 Spring Boot 中不起作用
【发布时间】:2018-09-24 15:36:00
【问题描述】:

我对 Spring Boot 有疑问。我们的应用程序也可用作授权服务器和资源服务器。我们向用户提供令牌,并提供安全的休息控制器。

现在我们开始新的应用程序,我们决定使用 Spring Boot 2.0.1。我们已经在之前的应用程序(1.5.X)中实现了 Oauth 配置,所以我们想使用它。但是当我们添加资源服务器和授权配置时,我们得到了错误:

无法解析符号“XXX”

Spring 的所有 oauth2 特性都有 XXX,例如: @EnableResourceServer 注解、ResourceServerConfigurerAdapter、ResourceServerTokenServices、@EnableAuthorizationServer、AuthorizationServerConfigurerAdapter、JwtAccessTokenConverter 等等……

你能告诉我哪里有问题吗?我们还在 pom 中添加了这些依赖项:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
    <groupId>org.springframework.security.oauth</groupId>
    <artifactId>spring-security-oauth2</artifactId>
</dependency>
<dependency>
    <groupId>org.springframework.security</groupId>
    <artifactId>spring-security-jwt</artifactId>
</dependency>

他们在Idea中也是红色的:

感谢您的建议

【问题讨论】:

    标签: java spring spring-boot spring-security spring-security-oauth2


    【解决方案1】:

    自动配置功能已移至其自己的小库中。查看Spring Boot Migration Guide 和链接的Documentation

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-01-13
      • 2020-03-23
      • 2017-07-28
      • 2023-01-25
      • 2020-01-02
      • 1970-01-01
      • 2017-06-01
      • 2016-03-10
      相关资源
      最近更新 更多