File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -214,18 +214,19 @@ jobs:
214214
215215 # Create a properly URL-encoded request
216216 echo "Creating token exchange request..."
217- # URL encode the token
218- encoded_token=$(echo -n "$OIDC_TOKEN" | python3 -c 'import sys, urllib.parse; print(urllib.parse.quote(sys.stdin.read(), safe=""))')
219- curl_data="client_id=$IDENTITY_FEDERATION_CLIENT_ID&subject_token=$encoded_token&subject_token_type=urn:ietf:params:oauth:token-type:jwt&grant_type=urn:ietf:params:oauth:grant-type:token-exchange&scope=sql"
220217
221218 # Print request details (except the token)
222219 echo "Request URL: https://$DATABRICKS_HOST_FOR_TF/oidc/v1/token"
223- echo "Request data: $(echo "$curl_data" | sed 's/subject_token=.*&/ subject_token=REDACTED&/') "
220+ echo "Request data: client_id=$IDENTITY_FEDERATION_CLIENT_ID& subject_token=REDACTED&subject_token_type=urn:ietf:params:oauth:token-type:jwt&grant_type=urn:ietf:params:oauth:grant-type:token-exchange&scope=sql "
224221
225222 # Make the request with detailed info
226223 echo "Sending request..."
227224 response=$(curl -v -s -X POST "https://$DATABRICKS_HOST_FOR_TF/oidc/v1/token" \
228- --data-raw "$curl_data" \
225+ --data-urlencode "client_id=$IDENTITY_FEDERATION_CLIENT_ID" \
226+ --data-urlencode "subject_token=$OIDC_TOKEN" \
227+ --data-urlencode "subject_token_type=urn:ietf:params:oauth:token-type:jwt" \
228+ --data-urlencode "grant_type=urn:ietf:params:oauth:grant-type:token-exchange" \
229+ --data-urlencode "scope=sql" \
229230 -H "Content-Type: application/x-www-form-urlencoded" \
230231 -H "Accept: application/json" \
231232 2>&1)
You can’t perform that action at this time.
0 commit comments