Page 1 of 1

OAuth2Refresh - unknown field "redirect_uri"

Posted: Fri Dec 02, 2022 6:06 pm
by JereMiami
I had success with the OAuth2 command for Dropbox in obtaining a short lived token. But the API does not like the "redirect_uri" parameter coded into the OAuth2Refresh command. According to the Dropbox documents pertaining the refresh tokens, Dropbox does not ask for this parameter when issuing a refresh token and hence, the above error.

Is there any workaround for this? The cURL is:

Code: Select all

curl https://api.dropbox.com/oauth2/token \     -d grant_type=refresh_token \     -d refresh_token=<REFRESH_TOKEN> \     -u <APP_KEY>:<APP_SECRET>
Any suggestions on how I can post the data to the url so that I can get that refresh token?

Re: OAuth2Refresh - unknown field "redirect_uri"

Posted: Fri Dec 02, 2022 6:43 pm
by JereMiami
Nevermind - Here is the work-a-roud.

Code: Select all

on mouseUp
   put "XXXXX" into tAppKey
   put "YYYYY" into tAppSecret
   put "Authorization: Basic" && base64Encode(tAppKey & ":" & tAppSecret) into tHeaders
   set the httpHeaders to tHeaders 
   put "https://api.dropbox.com/oauth2/token" into tUrl
   post "grant_type=refresh_token&refresh_token=ZZZZZ" to tUrl
   put it into tResponse
end mouseUp