Spring security 筛选器无法访问Spring安全终结点

Spring security 筛选器无法访问Spring安全终结点,spring-security,Spring Security,我有这个配置 httpSecurity .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and() .cors().and() .csrf().disable() .authorizeRequests().antMatchers(HttpMethod.GET, "/api/v1/ping").permitAll()

我有这个配置

    httpSecurity
        .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()
        .cors().and()
        .csrf().disable()
        .authorizeRequests().antMatchers(HttpMethod.GET, "/api/v1/ping").permitAll()
        .antMatchers(AUTH_WHITELIST).permitAll()
        .anyRequest().authenticated().and()
            .addFilter(new AuthenticationFilter(authenticationManager()));

如果我尝试访问
/login
,它将使用我创建的
身份验证过滤器
,但对于其他端点,如
/api/v1/collection/pastDueContact
,它会拒绝访问。但它不使用
身份验证过滤器(我创建的自定义过滤器),我需要…

你的问题是什么?我如何让我的端点使用我创建的自定义过滤器。。。实际上,我的端点是无法到达的,如果我使用/api/v1/collection/pastDueContact,我会得到一个“拒绝访问”,如果我在末尾添加一些字符串只是为了得到一个404 Not Found,比如:/api/v1/collection/pastDueContactxxxx,我仍然会得到一个没有任何意义的“拒绝访问”…显示一下
AuthenticationFilter
的实现。我认为这没有任何关系因此,对于条目/报告/登录,它会进入过滤器,但对于我的其他端点,它不会..如果你是对的,我的道歉,我的AuthenticationFilter实现是关键,因为我实现了PasswordAuthentication,只有当我尝试登录时,它才进入其中。我所做的是创建一个自定义过滤器,扩展基本身份验证并添加到链中,它工作了。。。