From cc02794ce95726d30b705943a705b93f3acfdf5f Mon Sep 17 00:00:00 2001 From: Jack Jiang <75868393+jackj-msft@users.noreply.github.com> Date: Mon, 4 Mar 2024 01:52:34 -0800 Subject: [PATCH] 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 --- packages/bruno-electron/src/ipc/network/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/bruno-electron/src/ipc/network/index.js b/packages/bruno-electron/src/ipc/network/index.js index 6260d1dc7..3d100bd2f 100644 --- a/packages/bruno-electron/src/ipc/network/index.js +++ b/packages/bruno-electron/src/ipc/network/index.js @@ -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;