如何在wso2 esb中为不同的端点设置不同的授权标头 [英] how to set different authorization header for different endpoint in wso2 esb

查看:58
本文介绍了如何在wso2 esb中为不同的端点设置不同的授权标头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个分散收集代理实现,在该实现中,我需要调用具有不同授权标头(不同系统的用户名和密码不同)的多个端点系统.目前,我的esb仅呼叫一个端点,而丢弃具有不同凭据的其他端点.

I have a scatter gather proxy implementation in which I need to call multiple endpoint systems which have different authorization header (username and password is different for different systems). Currently my esb calls only one endpoint and it discards others having different credentials.

请帮助.

推荐答案

如果您的后端使用基本身份验证,则在每次调用后端之前设置授权"标头都可以使用.

If your backends use basic authentication, it should work if you set the "Authorization" header before each call of the backends.

<property xmlns:ns="http://org.apache.synapse/xsd"  
       name="Authorization"  
       expression="fn:concat('Basic ', base64Encode('username:password'))"  
       scope="transport"/>  
  <send>  endpoint1

.....

<property xmlns:ns="http://org.apache.synapse/xsd"  
           name="Authorization"  
           expression="fn:concat('Basic ', base64Encode('username2:password2'))"  
           scope="transport"/>  
      <send>  endpoint2

这篇关于如何在wso2 esb中为不同的端点设置不同的授权标头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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