Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
Currently I'm developing a .Net WinForms desktop app.
I initiate a token-based OAuth2 flow with this URL in IE11 (or to be more precise: the WebBrowser control of .Net WinForms):
I can login to an account and apply accept the app request. After that I should be redirected to <myRedirectUrl>
I get two different results:
1. If <myRedirectUrl> is "http://localhost" then I get "dnserror.html" in browser. Thsi should not happen.
2. If <myRedirectUrl> is a real URL I get redirected to the page. But: since it seems to be some JavaScript.Magic to redirect, the page is "redirected/reloaded": neither DocumentCompleted event nor Navigating event is fired. Therefore I never can determine, when the redirected page is displayed in browser. For me the best woult be, if Navigating event would be fired.
What can I do to get the result by code like for other OAuth2 providers?
Regards,
Daniel
Steve,
Guess what? You were right. The /redirect_receiver is indeed doing something. I have just tried different redirect_uri and it worked fine.
Interesting. So I guess Navigated fires too late? But you tried Navigating as well, right? It seems like that should certainly fire before JavaScript on the page is executed.
Steve,
Yes, I have tried Navigating. It didn't work.
Hi Ivan,
here you can find my working solution. Maybe it helps you:
https://github.com/Kyrodan/KeeAnywhere/blob/master/KeeAnywhere/OAuth2/OAuth2Form.cs
I use the Navigated-Event.
The only drawback is, that due to the "JavaScript-Magic" the Default WebBrowser is opened on Windows 7 - no problems on Windows 10 (didn't ried on Vista,8, 8.1). In my opinion the JavaScript-stuff is crappy and not very stable. But I must say, that dropbox is one of the providers that implement OAuth2-Token-Flow "usable". For many others I need to use the Non-Fragment-URL-Way to a real existing Web-Server with a possible security problem - a no-go for a Desktop App.
Regards,
Daniel
Daniel,
Thank you for sharing and starting this discussion! I have already made it work by avoiding the use of the redirect_uri provided by Dropbox. In my experience the Javascript has to be kept as simple as possible. Otherwise the WebBrowser control is not able to handle rendezvous-process properly.
Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!