WebFlux身份验证失败,导致两次调用身份验证

时间:2020-03-16 02:22:56

标签: spring-security spring-webflux

我使用ServerSecurityContextRepository加载方法实现身份验证,如果令牌错误,它将调用两次,如果正确的令牌正常工作,那么有人知道吗?

return Mono.justOrEmpty(serverWebExchange)
                .then(authenticationConverter.convert(serverWebExchange))
                .flatMap(this::authenticateToken)
                .map(authentication -> {
                    addHeader(serverWebExchange, (CustomerUser) authentication.getPrincipal());
                    return new SecurityContextImpl(authentication);
                });

0 个答案:

没有答案