Created
October 24, 2016 06:40
-
-
Save genzj/a4e5580a75882331aafc4b11a1e5e106 to your computer and use it in GitHub Desktop.
Retrieve an unscoped token from Keystone.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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