Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Quick script to generate Brightbox cloud API tokens for different environments
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.

Get Token

This is a simple Ruby script to generate API tokens from the Brightbox Cloud API using your credentials.

Details about the Brightbox Cloud are available here:

The Brightbox API uses OAuth2 (Draft 10) token based authentication for all of it's requests. So if you find yourself making requests from curl getting valid tokens becomes a pain.

Whilst useful at a low level, you might find using the Brightbox CLI tools ( or the Fog library ( more use.


The script uses your existing Fog credentials to access the Brightbox URL, client ID and secret and perform an API call to request a token.

Fog supports multiple sets of credentials, each can be setup separately.

  :brightbox_client_id:   cli-named
  :brightbox_secret:      zsp3mk48hwhklt
  :brightbox_auth_url:    ""
  :brightbox_api_url:     ""
  :brightbox_client_id:   cli-kklds
  :brightbox_secret:      3hht333qjfDsa17

(These are fake values before you think I wasn't paying attention!)


Given it's goal, it is pretty minimal.

Run the script without arguments and it will use your default credentials.

$ get_token

Run the script with the name of another set of credentials it uses them instead

$ get_token additional
$ curl -H "Authorization: OAuth `get_token`"
... Lots of JSON ...

Future development

This is a pretty simple tool that might be useful to someone else. No real additional work on this script.

A replacement tool is planned.

  • Delivered as a gem
  • Will also check Brightbox CLI credentials for possible matches
Something went wrong with that request. Please try again.