From e93a4bf84071cd7bf8eb35fa9bcf6c20c14acc1b Mon Sep 17 00:00:00 2001 From: kavindu Date: Mon, 12 Aug 2019 16:27:52 +0530 Subject: [PATCH] Add the scopes for token api call --- get-wum-uat-products.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) mode change 100644 => 100755 get-wum-uat-products.sh diff --git a/get-wum-uat-products.sh b/get-wum-uat-products.sh old mode 100644 new mode 100755 index f64e5b4..33b2909 --- a/get-wum-uat-products.sh +++ b/get-wum-uat-products.sh @@ -27,6 +27,8 @@ CHANNEL_LIST=${CHANNEL_LIST} JOB_LIST=${JOB_LIST} PRODUCT_ID=${PRODUCT_ID} PRODUCT_ID_LIST=${PRODUCT_ID_LIST} +LIVE_SCOPES=${LIVE_SCOPES} +UAT_SCOPES=${UAT_SCOPES} #Generating access token for WUM Live environment to get the latest live synced timestamp createAccessTokenLive() { @@ -35,7 +37,7 @@ createAccessTokenLive() { #echo "Calling URI (POST): " ${uri} curl -s -X POST -H "Content-Type:application/x-www-form-urlencoded" \ -H "Authorization:Basic ${WUM_APPKEY_LIVE}" \ - -d "grant_type=password&username=${OS_USERNAME}&password=${OS_PASSWORD}" "${uri}" \ + -d "grant_type=password&username=${OS_USERNAME}@wso2um&password=${OS_PASSWORD}&scope=${LIVE_SCOPES}" "${uri}" \ --output "${CONFIG_FILE_LIVE}" live_access_token=$( jq -r ".access_token" $CONFIG_FILE_LIVE ) } @@ -47,7 +49,8 @@ createAccessTokenUAT() { #echo "Calling URI (POST): " ${uri} curl -s -X POST -H "Content-Type:application/x-www-form-urlencoded" \ -H "Authorization:Basic ${WUM_APPKEY_UAT}" \ - -d "grant_type=password&username=${OS_USERNAME}&password=${OS_PASSWORD}" "${uri}" \ + -d "grant_type=password&username=${OS_USERNAME}@wso2umuat&password=${OS_PASSWORD}&scope=${UAT_SCOPES}" + "${uri}" \ --output "${CONFIG_FILE_UAT}" #get only the access token value from the json response