From 6d3eea305837c42fe5095d5ce55ef5dd54672657 Mon Sep 17 00:00:00 2001 From: Hieu LE Date: Fri, 25 Mar 2016 14:52:11 +0700 Subject: [PATCH] Add project scoped token when obtaning token Currently, when using script federated_login.sh, it will throw error about using a project scoped token. This patch aim to provide missing project scoped token when using in k2k system. Change-Id: I79ead3a6c553754fbd2e37e7c1a2f6958e6bff14 Closes-Bug: #1561875 --- scripts/federated-login.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/federated-login.sh b/scripts/federated-login.sh index 5241157d68..6003cff2db 100755 --- a/scripts/federated-login.sh +++ b/scripts/federated-login.sh @@ -67,7 +67,7 @@ fi echo Performing federated login... # obtain a scoped token from the identity provider -curl -v -s -X POST -H "Content-Type: application/json" -d '{"auth":{"identity":{"methods":["password"],"password":{"user":{"name":"'"$OS_USERNAME"'","password":"'"$OS_PASSWORD"'","domain":{"name":"'"$OS_USER_DOMAIN_NAME"'"}}}}}}' $OS_AUTH_URL/auth/tokens >token.json 2>token.txt +curl -v -s -X POST -H "Content-Type: application/json" -d '{"auth":{"scope": {"project":{"domain": {"name": "'"$OS_DOMAIN_NAME"'"}, "name": "'"$OS_PROJECT_NAME"'"}},"identity":{"methods":["password"],"password":{"user":{"name":"'"$OS_USERNAME"'","password":"'"$OS_PASSWORD"'","domain":{"name":"'"$OS_DOMAIN_NAME"'"}}}}}}' $OS_AUTH_URL/auth/tokens >token.json 2>token.txt if [ "$?" != "0" ]; then echo "Could not obtain IdP token, did you forget to import your openrc file? See token.json and error.log for details." exit 1