springsecurity oauth2认证服务器 自定义登陆页面导致客户端授权异常处理

如果认证服务器使用自定义登陆页面,且静态资源通过如下配置,将导致授权码模式客户端跳转认证服务器登陆成功后无法完成客户端授权,页面将跳转到/error

WebSecurityConfig
@Override
public void configure(WebSecurity web) throws Exception {
    web.ignoring().antMatchers("/js/**");
    web.ignoring().antMatchers("/css/**");
    web.ignoring().antMatchers( "/images/**");
}

使用默认登陆页面,或修改为如下配置问题解决,原因待查

@Override
protected void configure(HttpSecurity http) throws Exception {
	 http.authorizeRequests()
                .antMatchers("/js/**", "/css/**", "/images/**").permitAll()
                .anyRequest().authenticated();
}

posted on 2020-03-31 15:49  路过君  阅读(840)  评论(0编辑  收藏  举报

导航