How to put HTTP Basic Auth as part of a sonata-type Nexus url to download artifacts?

I can download the file from Sonatype Nexus using the HTTP Basic Authentication Credentials in the HTTP header.

But I can’t achieve this by entering 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 and how I can achieve the same without using auth in the headers?

PS: this is a test environment - therefore, there is no SSL.

+6
source share
1 answer

You must use the authorization header, so you need to use a client that can set the authorizaiton HTTP header. If you have curl or wget, you can do it like:

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

+4
source

Source: https://habr.com/ru/post/982899/


All Articles