1

您好 Spring WebFlux 社区,我已经使用以下代码在 spring webflux 安全 bean 中实现了基于 x509 的身份验证:

@Bean
public SecurityWebFilterChain securityWebFilterChain(ServerHttpSecurity http) {

ReactiveAuthenticationManager authMan = auth0 -> {
    ..//lambda logic of setAuthenticated true, HERE I NEED TO ACCESS CURRENT REQUEST HEADERS VALUE BEFORE SETTING IT TO TRUE
};

   http.x509(x509 -> x509
                .principalExtractor(myx509PrincipalExtractor())
                .authenticationManager(authMan ))
        .authorizeExchange(exchanges ->
            exchanges.anyExchange().authenticated());
   return http.build();
}

现在,请注意 auth0 lambda 中的注释部分,我需要访问当前请求的标头值。我怎么能得到那个?

4

0 回答 0