Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the scopes for token API call #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions get-wum-uat-products.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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 )
}
Expand All @@ -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
Expand Down