Is there a way to test artifactory credentials and if I can successfully access a repository? running from the command line I cannot see if the credentials are used and from a browser with the ?trace appended to the url denies the anonymous user access.
You could make use of the Artifactory REST API to test your credentials. Access it from the command line via the curl command:
curl -u myUser:myP455w0rd! -X GET "http://<artifactory-url>:8080/artifactory/api/build"
If your credentials are correct, this should show you all builds in Artifactory.
if ! curl --fail-with-body --noproxy '*' --netrc --head 'https://<artifactory-url>:8080/artifactory/api/npm/auth' ; then
# handle error here
fi
In my case:
Above curl command works like this:
[1]
{
"errors" : [ {
"status" : 404,
"message" : "No builds were found"
} ]
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With