Reputation: 878
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.
Upvotes: 6
Views: 10774
Reputation: 705
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"
} ]
}
Upvotes: 0
Reputation: 16778
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.
Upvotes: 5