我有关于 Spring Boot 的问题。我们的应用程序也充当授权服务器和资源服务器。我们向用户提供 token 并保护休息 Controller 。
现在我们开始新的应用程序,我们决定使用 Spring Boot 2.0.1。我们已经在之前的应用程序(1.5.X)中实现了 Oauth 配置,因此我们想使用它。但是当我们添加资源服务器和授权配置时,我们收到错误:
Cannot resolve symbol "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 中也是红色的:
谢谢建议
最佳答案
自动配置功能已移至其自己的小库中。请参阅Spring Boot Migration Guide和链接的 Documentation .
关于java - Oauth2 在 Spring Boot 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49831167/