0
votes

I have endpoint from thirdparty that require us to authenticate. The response from endpoint authenticate is a cookie session. I need to fetch the cookie response from this authentication endpoint, and then to call another endpoint (e.g : search endpoint) with this cookie.

I'm trying without wso2 and no problem with it, and the problem is while using wso2 ESB.

I have successfuly request endpoint authentication via wso2 ESB and, the response is return success, Then i try to call another endpoint (e.g : search endpoint), the response is 403 forbidden (authenticate failed), that mean cookie is not send/set in search endpoint.

How can i fix this ?

I have try : 1. WSO2 ESB Getting a cookie from transport header with multiple cookies 2. In WSO2 ESB, how to store cookies and use them later for authentication?

Thanks a lot

1
It would be awesome if you could provide a Minimal, Complete, and Verifiable example - Pirate X

1 Answers

0
votes

Have you set the cookie?As you haven't provided details of your code.

<property xmlns:ns="http://org.apache.synapse/xsd" name="Cookie" expression="$trp.Set-Cookie"></property>

<property name="Cookie" value="JSESSIONID=1" scope="transport"/>

If the response from first call is a cookie session then i would suggest that you can write the session in a registry file so that you can fetch the session whenever you want.