How To Add Extra Users To Your Rackspace Cloud Account With The Identity API

Filed in Product & Development by Hart Hoover | July 17, 2012 3:30 pm

EDITOR’S NOTE (December 27, 2012): This feature is temporarily unavailable. We will update you once it becomes available again.

It’s been one of the most requested features of Rackspace Cloud: the ability to have multiple control panel logins for one account[1]. And now with our open cloud platform and the Identity Service API, we’ve made that possible.

Rackspace cloud customers can add separate accounts using the Identity Service API documented here:

http://docs.rackspace.com/auth/api/v2.0/auth-client-devguide/content/QuickStart-000.html[2]

To add a user to your account, you need your “master” username and API key, and curl. You will also need to be a customer of the new open Rackspace Cloud platform. The first step is to authenticate against the Identity API and get an authentication token to use for subsequent commands:

curl -X POST https://identity.api.rackspacecloud.com/v2.0/tokens -d '{ "auth":{ "RAX-KSKEY:apiKeyCredentials":{ "username":"$USERNAME", "apiKey":"$APIKEY" } } }' -H "Content-type: application/json"

You’re looking for the “token ID” in the response. Once you have it, you can create users for the control panel by using it to replace the username, email, password and token in this command:

curl –X POST https://identity.api.rackspacecloud.com/v2.0/users -d '{"user": {"username": "$USERNAME", "email":"email@domain.com", "enabled": true, "OS-KSADM:password":"$PASSWORD"}}' -H "Content-type: application/json" -H "X-Auth-Token: $TOKEN"

If you decide that you want to revoke access to your account, you can delete the user. To do that, authenticate again using your master account, then delete the user using the ID:

curl -X DELETE https://identity.api.rackspacecloud.com/v2.0/users/12345 -H "X-Auth-Token: "$TOKEN""

To get a listing of users (and their IDs) on your account, perform a GET request:

curl https://identity.api.rackspacecloud.com/v2.0/users -H "X-Auth-Token: "$TOKEN""

That is just one of the new capabilities available on the Rackspace open cloud platform. Be sure to check back for more ways to leverage the open Rackspace Cloud.

Endnotes:
  1. have multiple control panel logins for one account: http://feedback.rackspacecloud.com/forums/71021-product-feedback/suggestions/1002871-multiple-control-panel-users-per-account
  2. http://docs.rackspace.com/auth/api/v2.0/auth-client-devguide/content/QuickStart-000.html: http://docs.rackspace.com/auth/api/v2.0/auth-client-devguide/content/QuickStart-000.html

Source URL: http://www.rackspace.com/blog/how-to-add-extra-users-to-your-rackspace-cloud-account-with-the-identity-api/