Java 尽管允许对该端点的所有调用,但Auth0仍出现403错误?
我使用Spring项目设置了Auth0,以添加身份验证/授权。它工作得很好,但是当我调用“/user/login”端点时,当它应该允许所有请求时,我得到一个403错误 这是我的自定义配置:Java 尽管允许对该端点的所有调用,但Auth0仍出现403错误?,java,spring,auth0,Java,Spring,Auth0,我使用Spring项目设置了Auth0,以添加身份验证/授权。它工作得很好,但是当我调用“/user/login”端点时,当它应该允许所有请求时,我得到一个403错误 这是我的自定义配置: @Override protected void configure(HttpSecurity http) throws Exception { http.cors().and().csrf().disable().authorizeRequests() .antMatcher
@Override
protected void configure(HttpSecurity http) throws Exception {
http.cors().and().csrf().disable().authorizeRequests()
.antMatchers(HttpMethod.POST, SIGN_UP_URL).permitAll()
.antMatchers(HttpMethod.POST, LOGIN_URL).permitAll()
.anyRequest().authenticated()
.and()
.addFilter(new JWTAuthenticationFilter(authenticationManager()))
.addFilter(new JWTAuthorizationFilter(authenticationManager()))
// this disables session creation on Spring Security
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS);
}
对于注册url来说,它工作得非常好
什么可能导致此问题?您确定端点相同吗?还要检查方法是否为POST。另外,试着检查授权过滤器是否以403代码响应。谢谢,我找到了答案。原来我送的尸体是不正确的。。。谢谢你!