简体   繁体   中英

Oauth2 doesn't work in Spring Boot

I have question about Spring Boot. Our app works as Authorization server and Resource server as well. We provide token to users and also secure rest controllers.

Now we starting new app and we decide to use Spring Boot 2.0.1. We have implemented Oauth configuration in previous app (1.5.X) so we wanted to use it. But when we added Resource server and Authorization configuration we got error:

Cannot resolve symbol "XXX"

There are instead XXX all oauth2 features of spring like: @EnableResourceServer annotation, ResourceServerConfigurerAdapter, ResourceServerTokenServices, @EnableAuthorizationServer, AuthorizationServerConfigurerAdapter, JwtAccessTokenConverter, and so on ...

Can you tell me where is problem? We also have added these dependencies in 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>

They are also red in Idea:

在此处输入图片说明

Thanks in advice

The autoconfiguration features have moved to their own little library. See the Spring Boot Migration Guide and the linked Documentation .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM