Why is the Wget client not sending my authentication to Artifactory?

By default, the wget client does not use preemptive authentication. This means that the first request is sent without the authentication, and after the client receives a 401 challenge from the server, the wget client will send the request again with the credentials.


For example, when sending a command like this, the Artifactory request.log file will contain entries like the following:

Query:

wget -d –http-user=admin –http-password=mypassword http://localhost:8081/artifactory/libs-release-local/oracle/ojdbc14/1.0/ojdbc14-1.0.jar

request.log:

20140917142946|5|REQUEST|127.0.0.1|non_authenticated_user|GET|/libs-release-local/oracle/ojdbc14/1.0/ojdbc14-1.0.jar|HTTP/1.1|401|0

20140917142946|14|REQUEST|127.0.0.1|admin|GET|/libs-release-local/oracle/ojdbc14/1.0/ojdbc14-1.0.jar|HTTP/1.1|200|1536979


With anonymous access turned on, Artifactory will not return a 401 challenge at all and the request will be handled based on the anonymous user’s permissions.


 You can add the ‘–auth-no-challenge’ flag to the command to bypass the 401 challenge.


For example:

wget –auth-no-challenge -d –http-user=admin –http-password=mypassword http://localhost:8081/artifactory/libs-release-local/oracle/ojdbc14/1.0/ojdbc14-1.0.jar


This should force the wget client to send the authentication with the first request.