How to put HTTP Basic Auth as Part of Sonatype Nexus URL for artifact Download?
basic-authentication, nexus
Solution
You have to use the authorization header, so you need to use a client that can set the authorizaiton http header. If you have curl or wget available you can do this as:
curl -u admin:admin123 http://nexus.example.com/nexus/service/local/artifact/maven/content?g=com.test&a=project&v=1.0&r=test_repo_1_release
wget --user=admin --password=admin123 http://nexus.example.com/nexus/service/local/artifact/maven/content?g=com.test&a=project&v=1.0&r=test_repo_1_release
Problem
I am able to download the file from Sonatype Nexus using HTTP Basic Authentication Credentials in the HTTP Header. But I am not able to achieve this by putting in the credentials as part of the url - something like this: ``` http://admin:admin123@nexus.example.com/nexus/service/local/artifact/maven/content?g=com.test&a=project&v=1.0&r=test_repo_1_release ``` Does anyone know why or how I can achieve the same thing without using auth in headers? PS: this is a test environment - hence no SSL.