Alka
Alka

Reputation: 95

how to set different authorization header for different endpoint in wso2 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.

Please help.

Upvotes: 1

Views: 2001

Answers (1)

Martin Hald
Martin Hald

Reputation: 676

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

Upvotes: 2

Related Questions