有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java Oauth2在Spring Boot中不工作

我对弹簧靴有疑问。我们的应用程序可以作为授权服务器和资源服务器。我们向用户提供令牌,还提供安全的rest控制器

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

Cannot resolve symbol "XXX"

spring的所有oauth2特性如下: @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>

他们的想法也是红色的:

enter image description here

谢谢你的建议


共 (1) 个答案