Atom feed of this document
 
 
 

 3.1. Authentication

Client authentication is provided through a ReST interface using the GET method, with v1.0 supplied as the path. Additionally, two headers are required, X-Auth-User and X-Auth-Key with values for the username and API Access Key respectively.

Each ReST request against the Cloud Files system requires the inclusion of a specific authorization token HTTP x-header, defined as X-Auth-Token. Clients obtain this token, along with the Cloud Servers API URL, by first using the Rackspace Cloud Authentication Service and supplying a valid username and API access key.

The Rackspace Cloud Authentication Service is a ReSTful web service. It is the entry point to all Rackspace Cloud APIs.

To access the Authentication Service, you must know whether your account is US-based or UK-based:

Your account may be based in either the US or the UK; this is not determined by your physical location but by the location of the Rackspace site which was used to create your account:

If you are unsure how your account was created, use the Rackspace contact information at either site to ask for help.

 Request

To authenticate and get your Auth token, you must supply your username and API Key in x-headers:

  • Use your Rackspace Cloud username for your username for the API. Place it in the X-Auth-User x-header, like X-Auth-User: jdoe.

  • Get Your API Key

    Log in to the Rackspace Cloud Control Panel and get your API key.

    • In the Classic Control Panel, your API Key can be found under Your Account | API Access.

    • In the Cloud Control Panel, your API Key can be found by clicking the downward arrow next to your user name and selecting API Keys.

    In either Control Panel, click the Show Key button to get your key. Place your API Key in the X-Auth-Key x-header, like X-Auth-Key: a86850deb2742ec3cb41518e26aa2d89.

 

Example 3.1. Authentication Request (US-Based Account)

  GET /v1.0 HTTP/1.1
  Host: identity.api.rackspacecloud.com
  X-Auth-User: jdoe
  X-Auth-Key: a86850deb2742ec3cb41518e26aa2d89
                    

 Response

When you successfully authenticate your session, an HTTP status 204 (No Content) is returned with the X-Storage-Url, X-CDN-Management-Url, and X-Auth-Token headers. The headers can be processed as is, and any 2xx response is a good response. For example, a 202 response means the request has been accepted. (Additional x- headers related to other Rackspace services may be returned; they can be ignored.) An HTTP status of 401 (Unauthorized) is returned upon authentication failure. Use the URL returned for X-Storage-Url to perform the operations in the Developer's Guide.

For most operations, you will need to use your Auth token (X-Auth-Token). For security, it expires every 24 hours.

 

Example 3.2. Authentication Response

  HTTP/1.1 204 No Content
  Date: Mon, 12 Nov 2007 15:32:21 GMT
  X-Storage-Url: https://storage.clouddrive.com/v1/CF_xer7_34
  X-CDN-Management-Url: https://cdn.clouddrive.com/v1/CF_xer7_34
  X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb
  Content-Length: 0
  Content-Type: text/plain; charset=UTF-8
              

You use the X-Storage-Url and X-CDN-Management-Url headers when you perform operations on your Cloud Files account. From the example response above, users connecting to Cloud Files use the host header storage.clouddrive.com; the sample account name is CF_xer7_34. Auth tokens are valid for a 24 hours. Once a token expires, you must request a new one.

Note: To CDN-enable Containers or adjust CDN attributes, requests must be sent to cdn.clouddrive.com.



loading table of contents...