Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to to use Jenkins API tokens with wget

Tags:

curl

jenkins

wget

Something really weird is happening regarding performing HTTP calls to a private Jenkins instance (using GitHub authentication).

curl works: curl -u myuser:mytoken https://jenkins.example.com or via curl https://myser:[email protected]

Doing the same with wget does not work, giving: HTTP request sent, awaiting response... 403 Forbidden

Note: wget --http-user=<user> --http-password=<token> <url> is the alternative syntax for wget, but both approaches to give the same results: 403.

like image 627
sorin Avatar asked Jul 28 '16 16:07

sorin


People also ask

Where are Jenkins API tokens stored?

The Jenkins master authenticates the user against a users' database, in case of a username:password combination, or by comparing tokens with the local user's API token, stored in the user's config. xml file, in case of username:APItoken authentication.

How do I use Jenkins API token in Postman?

Enter your Jenkins username. For Authentication token, enter your Jenkins API token. Select the CI project used for your API. Select Connect.


1 Answers

Try adding the --auth-no-challenge option to the wget command line.

like image 183
Alex O Avatar answered Oct 18 '22 06:10

Alex O