Forum Discussion

Cyber-Dog's avatar
Cyber-Dog
New member | Level 2
7 years ago

Need Clarification on the redirect uri round-trip behviour (Desktop .Net)

Hey All,

Just after some clarification, Im familiar with programming desktop software but new to the web world.

In regards to OAuth 2, I have two options for the redirect set.
-https://www.dropbox.com/oauth2/redirect_receiver
-https://www.dropbox.com/1/oauth2/redirect_receiver

I got these out of the guide here,
https://blogs.dropbox.com/developers/2014/04/dropbox-authorization-in-a-windows-forms-app/

They work in getting an access token, though two things happen that dont seem to be right.
One) The page tab stayed open; either blank or with a 404 error depending on the redirect uir used.
Two) The following code fails, which is straight from the guide I linked above. I have tried converting to the Api v2 and still failed, I get a 400 error.

var client = new WebClient();
        client.Headers["Authorization"] = "Bearer " + accessToken;
        var accountInfo = client.DownloadString("https://www.dropbox.com/1/account/info");
        MessageBox.Show("Account info: " + accountInfo);

 

If calirication on the above could be explained that would be greatly appreciated.
Also, if you have any information on how I would make the url redirect back to my app after clicking Authroize, that would also be greatly appreciated

 

:)

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,946 PostsLatest Activity: 3 hours ago
351 Following

If 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!