0

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

Community
  • 1
  • 1
Cris
  • 1
  • 1
  • It would be awesome if you could provide a [Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve) – Pirate X Mar 28 '18 at 09:02

1 Answers1

0

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.

amg_amit
  • 495
  • 1
  • 3
  • 9