0
点赞
收藏
分享

微信扫一扫

SPECjvm2008_1_01 openjdk8 x86_64 ARM64 运行时长、成绩 Run is valid, but not compliant

青乌 2023-07-28 阅读 44

报错内容 

原因:没有指定userService类

错误地方:

@EnableWebSecurity
public class AuthWebServiceSecurityConfig extends WebSecurityConfigurerAdapter {

    /**
     * 对请求进行鉴权的配置
     */
    @Override
    protected void configure(HttpSecurity http) throws Exception {
        http.authorizeRequests()
                //.antMatchers().permitAll()
                .anyRequest().authenticated()
                .and()
                // 暂时关闭CSRF校验,允许get请求登出
                .csrf().disable();
    }
}

修改:

@EnableWebSecurity
public class AuthWebServiceSecurityConfig extends WebSecurityConfigurerAdapter {

    @Autowired
    private AuthUserDetailsService authUserDetailsService;

    /**
     * 对请求进行鉴权的配置
     */
    @Override
    protected void configure(HttpSecurity http) throws Exception {
        http.userDetailsService(authUserDetailsService);
        http.authorizeRequests()
                //.antMatchers().permitAll()
                .anyRequest().authenticated()
                .and()
                // 暂时关闭CSRF校验,允许get请求登出
                .csrf().disable();
    }
}

其中 AuthUserDetailsService 为实现了UserDetailsService接口的实现类

举报

相关推荐

0 条评论