Manually setting up launchpad OAuth token

There is a great how-to for doing this:

This document just shows the actual curl commands required to do everything.

step 1: Get a request token

Run the following command command to obtain a request token:

curl --dump-header - -H "Content-Type: application/x-www-form-urlencoded" -X POST --data 'oauth_consumer_key=ci+airline+testing&oauth_signature_method=PLAINTEXT&oauth_signature=%26' https://launchpad.net/+request-token

This will return something like:

oauth_token=token_value&oauth_token_secret=secret_value

step 2: Authenticate

Authentication of the above token is required via your browser by visiting:

https://launchpad.net/+authorize-token?oauth_token={oauth_token}
eg:
https://launchpad.net/+authorize-token?oauth_token=token_value

step 3: Get the access token

Run the following command to exchange the request token for an access token:

curl --dump-header - -H "Content-Type: application/x-www-form-urlencoded" -X POST --data 'oauth_signature=%26{oauth_token_secret}&oauth_consumer_key={oauth_key}&oauth_token={oauth_token}&oauth_signature_method=PLAINTEXT' https://launchpad.net/+access-token

which returns something like:

oauth_token=token&oauth_token_secret=token_secret&lp.context=None

The oauth_token and oath_token_secret returned here plus the oauth_consumer_key will then be required by our API’s to use Launchpad.

Automatic creation of launchpad OAuth tokens

The following steps will enable the automatic creation of launchpad OAuth tokens. Running bin/create_lp_creds.py present in lp:uci-engine and following the on-screen instructions will produce the credentials file, lp_creds.txt. Sourcing this file will allow the engine to interact with launchpad on your behalf.

bzr branch lp:uci-engine
cd uci-engine
./bin/create_lp_creds.py  # Follow the instructions to choose 'Change anything'
                            on the web page that has been just created.
. lp_creds.txt            # Source the credentials file