Skip to content

Commit 5b74b60

Browse files
committed
debug
1 parent e8d4a48 commit 5b74b60

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

.github/workflows/token-federation-test.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff 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)

0 commit comments

Comments
 (0)