找不到启用 OAuth2Sso 注释的导入



我尝试重复以下教程:

http://www.baeldung.com/sso-spring-security-oauth2

我有以下依赖项:

dependencies {
    compile('org.springframework.boot:spring-boot-starter-web')
    testCompile('org.springframework.boot:spring-boot-starter-test')
    compile('org.springframework.boot:spring-boot-starter-security')
    compile("org.springframework.security.oauth:spring-security-oauth2:2.3.2.RELEASE")
    compile('org.springframework.boot:spring-boot-starter-thymeleaf')
    compile('org.thymeleaf.extras:thymeleaf-extras-springsecurity4:2.1.2.RELEASE')
}

我有以下课程:

import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
    @Configuration
    @EnableOAuth2Sso
    public class UiSecurityConfig extends WebSecurityConfigurerAdapter {
        @Override
        public void configure(HttpSecurity http) throws Exception {
            http.antMatcher("/**")
                    .authorizeRequests()
                    .antMatchers("/", "/login**")
                    .permitAll()
                    .anyRequest()
                    .authenticated();
        }
    }

如您所见,我没有导入@EnableOAuth2Sso注释。Idea不建议我导入自动完成。

我做错了什么?

我替换了

 compile("org.springframework.security.oauth:spring-security-oauth2:2.3.2.RELEASE")

compile ("org.springframework.security.oauth.boot:spring-security-oauth2-autoconfigure:2.0.0.RELEASE")

和想法找到导入

最新更新