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

4

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. 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

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.

About the Author

This is a post written and contributed by Hart Hoover.

Hart Hoover is a 4-year Racker who works with Rackspace Cloud Builders to support private clouds. He was a founding member of the Managed Cloud Servers support team and loves helping companies realize the power of cloud technology. You can follow @hhoover for his tweets or find him at Geekdom.

4 Comments

This is awesome! Great job!

avatar Jordan Callicoat on July 29, 2012 | Reply

A minor point but the dash in the “curl –X POST” for the create user curl command is actually an em dash (at least that’s how it is with Google Chrome on a Mac). If you copy and paste this command into the terminal directly, you’ll see the errors:

curl: (6) Could not resolve host: –X; nodename nor servname provided, or not known
curl: (6) Could not resolve host: POST; nodename nor servname provided, or not known

The command actually still works but it could be misleading to some. Hope this helps someone.

avatar Everett Toews on August 1, 2012 | Reply

Is there any timeline on when sub-users will become available again?

avatar jim culbreath on February 14, 2013 | Reply

Hello Jim!

Rackspace is definitely working on it. We hope to have this feature in the first half of this year.

avatar Hart Hoover [Racker] on February 14, 2013

Leave a New Comment

(Required)


©2013 Rackspace, US Inc. About Rackspace | Fanatical Support® | Hosting Solutions | Investors | Careers | Privacy Statement | Website Terms | Trademarks | Sitemap