Skip to content

Instantly share code, notes, and snippets.

@genzj
Created October 24, 2016 06:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save genzj/a4e5580a75882331aafc4b11a1e5e106 to your computer and use it in GitHub Desktop.
Save genzj/a4e5580a75882331aafc4b11a1e5e106 to your computer and use it in GitHub Desktop.
Retrieve an unscoped token from Keystone.
#!/bin/bash
default_domain_name='default'
if [[ $# -lt 2 ]] ; then
echo "Usage: $0 USERNAME PASSWORD"
exit 1
fi
curl -i \
-H "Content-Type: application/json" \
-d '
{ "auth": {
"identity": {
"methods": ["password"],
"password": {
"user": {
"name": "'"$1"'",
"domain": { "name": "'$default_domain_name'" },
"password": "'"$2"'"
}
}
}
}
}' \
http://localhost:5000/v3/auth/tokens ; echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment