Sign In Dropbox using oAuth 2
Posted: Thu May 15, 2014 10:57 am
I'm posting this on behalf of wimpykid1570, who is a new member and hence unable as yet to post urls.
Hi,
I tried to sign in my dropbox account using oAuth 2 from a desktop app on Windows 8.1.
1. I don't have IIS installed so I don't have a localhost and I don't want to use an external link for redirect_uri. What should I put in for redirect_uri which is a required field? Can I use a variable or a local file path so that I can retrieve my access code?
2. I tried to detect when dropbox redirect to my redirect_uri (which now I use a fake one) so that I can look at the response header, but the browserBeforeNavigate does not get triggered.
Thanks in advance for any ideas or suggestions.
on mouseUp
put "xxxxxxx" into tAppKey
put base64Encode(randomBytes(16)) into tCSRFToken
put "https://www.dropbox.com/1/oauth2/authorize?" & \
"response_type=token&" & \
"state=" & tCSRFToken & "&" & \
"client_id=" & tAppKey & "&" & \
"redirect_uri=SOME_THING" \
into tRequest
put revBrowserOpen((the windowId of this stack), tRequest) into tBrowserId
revBrowserSet tBrowserId, "showborder", "true"
revBrowserSet tBrowserId, "rect", the rectangle of image "MyImage"
end mouseUp
on browserBeforeNavigate bBrowserId, pURL
if "dropbox.com" is not in pURL then
put true into browserCancel
end if
end browserBeforeNavigate
Toan
Hi,
I tried to sign in my dropbox account using oAuth 2 from a desktop app on Windows 8.1.
1. I don't have IIS installed so I don't have a localhost and I don't want to use an external link for redirect_uri. What should I put in for redirect_uri which is a required field? Can I use a variable or a local file path so that I can retrieve my access code?
2. I tried to detect when dropbox redirect to my redirect_uri (which now I use a fake one) so that I can look at the response header, but the browserBeforeNavigate does not get triggered.
Thanks in advance for any ideas or suggestions.
on mouseUp
put "xxxxxxx" into tAppKey
put base64Encode(randomBytes(16)) into tCSRFToken
put "https://www.dropbox.com/1/oauth2/authorize?" & \
"response_type=token&" & \
"state=" & tCSRFToken & "&" & \
"client_id=" & tAppKey & "&" & \
"redirect_uri=SOME_THING" \
into tRequest
put revBrowserOpen((the windowId of this stack), tRequest) into tBrowserId
revBrowserSet tBrowserId, "showborder", "true"
revBrowserSet tBrowserId, "rect", the rectangle of image "MyImage"
end mouseUp
on browserBeforeNavigate bBrowserId, pURL
if "dropbox.com" is not in pURL then
put true into browserCancel
end if
end browserBeforeNavigate
Toan