cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Are you using the Microsoft co-authoring beta for Dropbox? Share your feedback and learn more about it here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

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

Cyber-Dog
New member | Level 2

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

 

🙂

1 Reply 1

Greg-DB
Dropbox Staff

That blog post is relatively old, and utilizes a mechanism we no longer support, per the note at the top. 

To answer your specific questions though, note that https://www.dropbox.com/oauth2/redirect_receiver does (without the "/1") does not appear in that post, and does not point to a valid page. Only https://www.dropbox.com/1/oauth2/redirect_receiver (with the  "/1") is valid. Further, while we supply that for your convenience, you do not need to use it. You can use your own redirect URI if desired.

Also, https://www.dropbox.com/1/account/info is part of API v1, which has since been retired and no longer works.

Instead, to use the current Dropbox API from .NET, you should use the official Dropbox API v2 .NET SDK. There's information on getting started there, as well as examples. You can find documentation on how to process the OAuth app authorization flow with that here.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?