You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
klm1
8 years agoHelpful | Level 6
Calling DropboxOAuth2Helper.ProcessCodeFlowAsync synchronously
From the OAuth guide:
"Note that for certain apps, such as command line and desktop apps, it's not possible for a web browser to redirect back to your app. In these cases, your app does not nee...
- 8 years ago
For anyone reading this topic, the good folks at Dropbox were able to identify the problem and fix it in version 4.2.5 of the SDK.
klm1
Helpful | Level 6
Hey Greg,
Normally (for asynchronous), you'd do something like this (basically changing the SimpleTest sample to allow inputing the authorization code into a text field, then converting that to an access token:
private async void OkClick(object sender, RoutedEventArgs e) { if (this.authorizationCode.Text == String.Empty) this.Close(); OAuth2Response response = await DropboxOAuth2Helper.ProcessCodeFlowAsync(authorizationCode.Text, appKey, appSecret); this.AccessToken = response.AccessToken; this.Uid = response.Uid; this.Result = true; this.Close(); }
That works fine and is ok as long as the function, OkClick in this simple example, can can be called asynchronously. (In our real use case, C++/CLI is the caller, and it doesn't know anything about async / await).
I tried doing this instead, which seems to work for most of the Dropbox .NET API calls (note the async and await are gone, but we wait for the task to complete using task.Wait() ):
private void OkClick(object sender, RoutedEventArgs e) { if (this.authorizationCode.Text == String.Empty) this.Close(); var task = DropboxOAuth2Helper.ProcessCodeFlowAsync(authorizationCode.Text, appKey, appSecret); task.Wait(); this.AccessToken = task.Result.AccessToken; this.Uid = task.Result.Uid; this.Result = true; this.Close(); }
If I step through the code, I never see the line executed after task.Wait(). Am happy to send you the source too, it's basically just a modified version of SimpleTest.
Greg-DB
8 years agoDropbox Staff
Yes, please do share that modified version of SimpleTest so we can reproduce this and look into it. Thanks in advance!
- klm18 years agoHelpful | Level 6
What's the best way to make the files available to you, Greg?
- Greg-DB8 years agoDropbox StaffYou can post a Dropbox shared link for the project:
https://www.dropbox.com/help/167
If you'd prefer to share privately, you can open an API ticket here instead:
https://www.dropbox.com/developers/contact- klm18 years agoHelpful | Level 6
For anyone reading this topic, the good folks at Dropbox were able to identify the problem and fix it in version 4.2.5 of the SDK.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,911 PostsLatest Activity: 3 hours agoIf you need more help you can view your support options (expected response time for an email or 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!