I am working for a company. When I access the web application on AWS from the browser, the gateway redirects to the authentication page (work with a proxy), after the authentication I can access the web application from the browser. The problem is that when I am using curl to call the api, the gateway is still redirecting my request to the authentication page. How to pass this authentication layer?
curl -X GET api-url.com
* HTTP 1.0, assume close after body
< HTTP/1.0 302 Moved Temporarily
< Location: https://company-internet-gateway.com:1234/php/uid.php...
< Content-Length: 0
< Pragma: no-cache
< Cache-Control: no-cache
<
* Closing connection 0
* TLSv1.2 (OUT), TLS alert, close notify (256):
Solved!
I added https_proxy with the proxy server then curl worked now.
export https_proxy=http://proxy_server:port