DEV@cloud » Accessing Jenkins using HTTP Basic Authentication

Accessing Jenkins using HTTP Basic Authentication

Last modified by Jesse Glick on 2013/07/10 16:34

When scripting or automating interaction with your DEV@cloud Jenkins instance, you need to pass your DEV@cloud username and Jenkins API key.  You can find your Jenkins API key by navigating to https://<account>.ci.cloudbees.com/me/configure and then click the "Show API Token" button. Then, pass this API token as your password using HTTP Basic Authentication:

$ curl -u you@yourcorp.com:myapitokenABCDEF1234 https://myjenkins.ci.cloudbees.com/api/json

If you pass the username and API key in the URL, they must be URL encoded:

$ curl https://you%40yourcorp.com:myAPIkey@myjenkins.ci.cloudbees.com/api/json

See also: Authenticating scripted clients

NOTE: The Java and Ruby standard libraries do not automatically parse out the username and password from the URL like many tools such as curl, wget and browsers do. 

Tags:
Created by Ryan Campbell on 2011/07/20 21:56