SpringBoot - 完全停用安全性以启用摘要转发

SpringBoot - Deactivate security completely to enable digest forwarding

我们正在构建一个基于 SpringBoot 的应用程序,它将像代理一样工作。它接受请求并将它们发送到另一个端点。这包括摘要身份验证。

Client --> Proxy (Spring) --> Resource

客户端和资源使用摘要式身份验证,无需代理即可正常工作。

我怎样才能完全禁用任何安全性,尤其是对摘要身份验证的默认处理,以明确转发请求(不需要讨论潜在的安全问题,这是有意的)。

我们尝试了 .authorizeRequests().antMatchers("/**").permitAll()security.ignored=/**management.security.enabled=false

@EnableAutoConfiguration(exclude = {
    org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration.class})

我测试过摘要转发在技术上是在 NodeJS/Express 堆栈上。

您必须忽略任何请求。此外,您必须删除 servlet 对摘要的过滤器(如果存在)。

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