Skip to content

Instantly share code, notes, and snippets.

@joesavak
Last active December 10, 2015 00:39
Show Gist options
  • Save joesavak/4353241 to your computer and use it in GitHub Desktop.
Save joesavak/4353241 to your computer and use it in GitHub Desktop.
Rackspace Identity v2.0 XML Authentication with API key
#authentication with username & API key:
curl $identity/v2.0/tokens -d '<?xml version="1.0" encoding="UTF-8"?><auth><apiKeyCredentials xmlns="http://docs.rackspace.com/identity/api/ext/RAX-KSKEY/v1.0" username="USERNAME" apiKey="APIKEY" /></auth>' -H "Content-type: application/xml" -H "Accept: application/xml"
#authentication with username, API key, and tenantId:
curl $identity/v2.0/tokens -d '<?xml version="1.0" encoding="UTF-8"?><auth><apiKeyCredentials xmlns="http://docs.rackspace.com/identity/api/ext/RAX-KSKEY/v1.0" username="USERNAME" apiKey="APIKEY" tenantId="TENANTID" /></auth>' -H "Content-type: application/xml" -H "Accept: application/xml"
#example response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<access
xmlns:os-ksadm="http://docs.openstack.org/identity/api/ext/OS-KSADM/v1.0"
xmlns="http://docs.openstack.org/identity/api/v2.0">
<token id="TOKENID" expires="2011-10-21T09:51:17.000-06:00">
<tenant id="TENANTID" name="TENANTID"/>
</token>
<user
xmlns:rax-auth="http://docs.rackspace.com/identity/api/ext/RAX-AUTH/v1.0"
id="10000" name="USERNAME" rax-auth:defaultRegion="DFW">
<roles>
<role id="3" name="identity:user-admin"
description="User Admin Role."/>
</roles>
</user>
<serviceCatalog>
<service type="volume" name="cloudBlockStoragePreview">
<endpoint region="Preview-ORD" tenantId="TENANTID"
publicURL="https://preview-ord.blockstorage.api.rackspacecloud.com/v1/TENANTID"
/>
</service>
<service type="rax:object-cdn" name="cloudFilesCDN">
<endpoint region="DFW" tenantId="TENANTID"
publicURL="https://cdn1.clouddrive.com/v1/TENANTID"/>
<endpoint region="ORD" tenantId="TENANTID"
publicURL="https://cdn2.clouddrive.com/v1/TENANTID"/>
</service>
<service type="compute" name="cloudServers">
<endpoint tenantId="TENANTID"
publicURL="https://servers.api.rackspacecloud.com/v1.0/TENANTID">
<version id="1.0"
info="https://servers.api.rackspacecloud.com/v1.0"
list="https://servers.api.rackspacecloud.com/"/>
</endpoint>
</service>
<service type="object-store" name="cloudFiles">
<endpoint region="DFW" tenantId="TENANTID"
publicURL="https://storage101.dfw1.clouddrive.com/v1/TENANTID"
internalURL="https://snet-storage101.dfw1.clouddrive.com/v1/TENANTID"/>
<endpoint region="ORD" tenantId="TENANTID"
publicURL="https://storage101.ord1.clouddrive.com/v1/TENANTID"
internalURL="https://snet-storage101.ord1.clouddrive.com/v1/TENANTID"
/>
</service>
<service type="volume" name="cloudBlockStorage">
<endpoint region="ORD" tenantId="TENANTID"
publicURL="https://ord.blockstorage.api.rackspacecloud.com/v1/TENANTID"/>
<endpoint region="DFW" tenantId="TENANTID"
publicURL="https://dfw.blockstorage.api.rackspacecloud.com/v1/TENANTID"
/>
</service>
<service type="rax:monitor" name="cloudMonitoring">
<endpoint tenantId="TENANTID"
publicURL="https://monitoring.api.rackspacecloud.com/v1.0/TENANTID"
/>
</service>
<service type="rax:load-balancer" name="cloudLoadBalancers">
<endpoint region="ORD" tenantId="TENANTID"
publicURL="https://ord.loadbalancers.api.rackspacecloud.com/v1.0/TENANTID"/>
<endpoint region="DFW" tenantId="TENANTID"
publicURL="https://dfw.loadbalancers.api.rackspacecloud.com/v1.0/TENANTID"
/>
</service>
<service type="rax:database" name="cloudDatabases">
<endpoint region="ORD" tenantId="TENANTID"
publicURL="https://ord.databases.api.rackspacecloud.com/v1.0/TENANTID"/>
<endpoint region="DFW" tenantId="TENANTID"
publicURL="https://dfw.databases.api.rackspacecloud.com/v1.0/TENANTID"
/>
</service>
<service type="rax:dns" name="cloudDNS">
<endpoint tenantId="TENANTID"
publicURL="https://dns.api.rackspacecloud.com/v1.0/TENANTID"
/>
</service>
<service type="compute" name="cloudServersOpenStack">
<endpoint region="ORD" tenantId="TENANTID"
publicURL="https://ord.servers.api.rackspacecloud.com/v2/TENANTID">
<version id="2"
info="https://ord.servers.api.rackspacecloud.com/v2"
list="https://ord.servers.api.rackspacecloud.com/"
/>
</endpoint>
<endpoint region="DFW" tenantId="TENANTID"
publicURL="https://dfw.servers.api.rackspacecloud.com/v2/TENANTID">
<version id="2"
info="https://dfw.servers.api.rackspacecloud.com/v2"
list="https://dfw.servers.api.rackspacecloud.com/"
/>
</endpoint>
</service>
</serviceCatalog>
</access>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment