83. 配置 Zuul 代理的下游身份验证

你可以通过 proxy.auth.* 设置控制 @EnableZuulProxy 下游的授权行为。例子:

application.yml. 

proxy:
  auth:
    routes:
      customers: oauth2
      stores: passthru
      recommendations: none

在这个例子中,"customers" 服务得到一个 OAuth2 令牌中继,"stores" 服务得到一个直通(授权头刚刚传递到下游),"recommendations" 服务删除了其授权头。默认行为是在有令牌可用的情况下执行令牌中继,否则执行传递。

完整细节请参阅 ProxyAuthenticationProperties。