gpt4 book ai didi

java - 找不到 EnableOAuth2Sso 注释的导入

转载 作者:行者123 更新时间:2023-11-30 02:11:58 24 4
gpt4 key购买 nike

我尝试重复以下教程:

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')
}

我有以下类(class):

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 不建议我导入 automcomplete。

我做错了什么?

最佳答案

我替换了

 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")

并且想法找到导入

关于java - 找不到 EnableOAuth2Sso 注释的导入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49798251/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com