title: spring cloud gateway 2 add Authentication info header
body: <p>I need add some user info which get from <code>exchange.getPrincipal()</code> to the forward request, and write a <code>GlobalFilter</code> like below:</p>
  
  <pre><code>public class UserInfoFilter implements GlobalFilter, Ordered {
  
  @Override
  public int getOrder() {
      return Ordered.HIGHEST_PRECEDENCE;
  }
  
  @Override
  public Mono&lt;Void&gt; filter(ServerWebExchange exchange, GatewayFilterChain chain) {
      ServerHttpRequest.Builder mutate = exchange.getRequest().mutate();
      return exchange.getPrincipal().map(principal -&gt; {
          if (principal instanceof Authentication) {
              Authentication authentication = (Authentication) principal;
              Object principal1 = authentication.getPrincipal();
              if (principal1 instanceof UserDetails) {
                  UserDetails user = (UserDetails) principal1;
                  mutate.header("userName", user.getUsername());
              }
          }
          return mutate;
      }).doOnSuccess(builder -&gt; chain.filter(exchange.mutate().request(builder.build()).build())).then();
  }
  </code></pre>
  
  <p>}</p>
  
  <p>but when I enable this filter, I will get nothing response just a 200 status code without any exception throw. I guess I use the wrong way of reactor, and I had try a lot but can't get it work.</p>