Use URL Encoded Form for OAuth2.0 token endpoint (#1701)

OAuth2.0 expects URL encoded form instead of JSON content
https://www.oauth.com/oauth2-servers/server-side-apps/example-flow/

Co-authored-by: Anoop M D <anoop.md1421@gmail.com>
This commit is contained in:
Jack Jiang 2024-03-04 01:52:34 -08:00 committed by GitHub
parent 858536e13d
commit cc02794ce9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -201,7 +201,8 @@ const configureRequest = async (
case 'authorization_code':
interpolateVars(requestCopy, envVars, collectionVariables, processEnvVars);
const { data: authorizationCodeData, url: authorizationCodeAccessTokenUrl } =
await resolveOAuth2AuthorizationCodeAccessToken(requestCopy);
await resolveOAuth2AuthorizationCodeAccessToken(requestCopy);
request.headers['content-type'] = 'application/x-www-form-urlencoded';
request.data = authorizationCodeData;
request.url = authorizationCodeAccessTokenUrl;
break;