【发布时间】: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