Skip to content

Commit 6ed3a90

Browse files
Merge pull request livecode#7381 from bwmilby/bwm-22557-oauth2
[Bug 22557] OAuth2 - Prevent double URL encoding of authentication code
2 parents 2aba9b8 + e08236c commit 6ed3a90

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# [22557] Prevent double URL encoding of authentication code

extensions/script-libraries/oauth2/oauth2.livecodescript

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,13 +238,14 @@ command OAuth2 pAuthURL, pTokenURL, pClientID, pClientSecret, pScopes, pPort, pP
238238

239239
local tResult
240240
put the dialogData into tResult
241+
-- all keys/values in tResult are already URL encoded
241242

242243
if tResult["code"] is not empty then
243244
local tParams
244245
put "grant_type=authorization_code" into tParams
245246
put "&client_id=" & urlEncode(pClientID) after tParams
246247
put "&client_secret=" & urlEncode(pClientSecret) after tParams
247-
put "&code=" & urlEncode(tResult["code"]) after tParams
248+
put "&code=" & tResult["code"] after tParams
248249
put "&redirect_uri=" & urlEncode(kRedirectURL & ":" & pPort & "/") after tParams
249250

250251
local tResponse

0 commit comments

Comments
 (0)