resttemplate带授权码请求我的github登录接口/auth/github报错,401

来源:6-6 重构社交登录

他门说这就是人生

2019-09-03

Full authentication is required to access this resource unauthorized

/auth/github已经暴露:

@Component
public class SecurityConfigerAdapter extends WebSecurityConfigurerAdapter {

    @Override
    public void configure(WebSecurity web) throws Exception {
        web.ignoring()
//                swagger2文档
                .antMatchers("/swagger-ui.html")
                .antMatchers("/webjars/**")
                .antMatchers("/v2/**")
                .antMatchers("/swagger-resources/**")
//              验证码
                .antMatchers(UrlConstants.CAPTCHA_URL, "/login/**", "/auth/github");
    }
}

请大家不吝赐教

写回答

1回答

JoJo

2019-09-03

/auth/github 这后面写了啥?你在这个配置里忽略了认证和权限,但是不代表你这个请求的处理逻辑中不需要用户信息啊。

0
1
他门说这就是人生
继承WebSecurityConfigurerAdapter覆盖configure方法,和覆盖资源服务器的configure方法有什么区别啊?我觉得有些资源放行要写在前者里,有些又要写在后者里才生效,否则没生效。老师,请老师赐教呀!
2019-09-03
共1条回复

Spring Security技术栈开发企业级认证与授权

Spring Security技术栈,REST风格开发常见接口,独立开发认证授权模块保证REST服务安全

2662 学习 · 1561 问题

查看课程