Curl authentication

Posted by Jack Humphries on Server Fault See other posts from Server Fault or by Jack Humphries
Published on 2012-12-16T20:31:39Z Indexed on 2012/12/16 23:05 UTC
Read the original article Hit count: 293

Filed under:
|
|
|
|

I am trying to download a file with cURL from a password protected directory on my site. It is not working. Instead of the downloading the requested file, it downloads a HTML file that says, "Authentication Required!" I'm not sure what the problem is.

I've tried both of these (with the same result). The username and password are correct (and if the link below is used in a web browser, the file downloads successfully).

1) The username and password are included as part of the URL.

curl https://username:[email protected]/auth/file.dmg --O /file.dmg;

2) The username and password are included as an option.

curl -u username:wordpass.1 https://www.example.com/auth/file.dmg --O /file.dmg;

© Server Fault or respective owner

Related posts about linux

Related posts about apache2