how to set different authorization header for different endpoint in wso2 esb

与世无争的帅哥 提交于 2021-01-28 14:26:13

问题


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.

Please help.


回答1:


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


来源:https://stackoverflow.com/questions/37816328/how-to-set-different-authorization-header-for-different-endpoint-in-wso2-esb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!