Skip to content

Instantly share code, notes, and snippets.

@flazz
Created September 6, 2016 14:17
Show Gist options
  • Save flazz/f0a28f89d8d3cc74711eb39de3ed1778 to your computer and use it in GitHub Desktop.
Save flazz/f0a28f89d8d3cc74711eb39de3ed1778 to your computer and use it in GitHub Desktop.
# credentials
# SSO=your.sso
# PASS=your.pass
# choose between prod or staging
HOST=https://staging.identity-internal.api.rackspacecloud.com
#HOST=https://identity-internal.api.rackspacecloud.com
# payload
DATA="{\"auth\":{\"RAX-AUTH:domain\":{\"name\":\"Rackspace\"},\"passwordCredentials\":{\"username\":\"${SSO}\", \"password\":\"${PASS}\"}}}"
# curl it
exec curl -v -H 'Content-Type: application/json' -X POST -d "${DATA}" "${HOST}/v2.0/tokens" | jq -r .access.token.id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment