I am trying to #redirect the request to gateway to an external website (https://www.icicibank.com) . However #redirection does not seem to be working. Below is the route assertion:
I tried with checking Follow-Redirect as well unsuccessfully. We need to redirect all the requests coming to policy to https://www.icicibank.com.
change https to http
That I tried and it works because www.icicibank.com has internal redirection from http to https. However there are other URLs, where we need to redirect (like
https://m2wnet.icicibank.co.in/STAR_M2W/oRegPg_reg ). Here with this site, there is no internal redirection from http to https and hence GW redirection does not working here. Please let me know if we can redirect to
https://m2wnet.icicibank.co.in/STAR_M2W/oRegPg_reg through Gateway policy.
I would check the logs for any errors. Typically you will see this type of error if you did not import the target cert into the gateway.
Problem routing to https://www.icicibank.com. Error msg: Unable to obtain HTTP response from https://www.icicibank.com found but not trusted for SSL
Alternatively, you could use an HTTP 302 redirect instead of an HTTP route assertion.
Tried with the redirection approach. That too is not working. We want to redirect to ICICI Bank Money2World: Register Now
However, neither route nor redirection approach seems to be working.
Hello SIDDHARTHJAISWAL ,
If only https has problem, I was wondering if you'd imported the certificate of icicibank?
Gateway won't trust any sites by default, need to import the certificate to trust the site.
if the only thing you want to do in policy is to redirect to the register endpoint, you only need to do the following:
Your overall policy should have two assertions now. (Not good enough for production but to get you started).
I tried this myself and it works perfectly fine. Its almost the same response as further up, just make sure the header gets added to the "Response".
We're actively doing exactly this in a few policies, however, I'm currently running into an issue where I need to redirect a POST request to an external URL with a GET request (erasing the data from the original POST). Is this possible to do with a 302 redirect like this?
An HTTP 303 can be used as a redirect for this. In the HTTP standard, only the status code 303 enforces rewriting the HTTP POST request to an HTTP GET request
303 See Other - HTTP | MDN
Hope this helps.
Awesome, I'll give that a try, thank you Joe!