Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to put HTTP Basic Auth as Part of Sonatype Nexus URL for artifact Download?

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:[email protected]/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.

like image 292
owaism Avatar asked Feb 23 '15 17:02

owaism


1 Answers

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

like image 168
rseddon Avatar answered Oct 09 '22 15:10

rseddon