Zuul称为基本身份验证服务 [英] Basic Authentication service called By Zuul

查看:109
本文介绍了Zuul称为基本身份验证服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Zuul作为边缘服务器.因此所有请求都通过此边缘服务器传递. 我有一个微服务A.A的所有Web服务均受基本身份验证的保护. 我们如何称呼Zuul代理传递的A b服务? 我应该为邮件添加标题吗?

I'm Zuul as edge server. so all request pass by this edge server. I have a micro-service A. all web services of A are protected by Basic Authentication. How can we call the services of A b passing by Zuul proxy? Should I add header for messages?

推荐答案

理想情况下,请求者将在请求中包含令牌.
如果要让Zuul添加身份验证令牌,则可以创建ZuulFilter并使用:

Ideally the requester would have the token in the request.
If you want to have Zuul add the authentication token then you can create a ZuulFilter and use:

context.addZuulRequestHeader("Authorization", "base64encodedTokenHere");

这样做可以使服务开放访问-这可能不是明智的选择.

Doing this would give open access to the services - which may not be wise.

这篇关于Zuul称为基本身份验证服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆