Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions extensions/script-libraries/oauth2/notes/22557.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# [22557] Prevent double URL encoding of authentication code
3 changes: 2 additions & 1 deletion extensions/script-libraries/oauth2/oauth2.livecodescript
Original file line number Diff line number Diff line change
Expand Up @@ -238,13 +238,14 @@ command OAuth2 pAuthURL, pTokenURL, pClientID, pClientSecret, pScopes, pPort, pP

local tResult
put the dialogData into tResult
-- all keys/values in tResult are already URL encoded

if tResult["code"] is not empty then
local tParams
put "grant_type=authorization_code" into tParams
put "&client_id=" & urlEncode(pClientID) after tParams
put "&client_secret=" & urlEncode(pClientSecret) after tParams
put "&code=" & urlEncode(tResult["code"]) after tParams
put "&code=" & tResult["code"] after tParams
put "&redirect_uri=" & urlEncode(kRedirectURL & ":" & pPort & "/") after tParams

local tResponse
Expand Down