cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more 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: 

How to get OAuth2 access token from OAuth1 token and secret with API v2 using C#

How to get OAuth2 access token from OAuth1 token and secret with API v2 using C#

AndreCk
Explorer | Level 3

Hi All

Im trying to detirmin if its possible to "convert"  OAuth1 token and secret with API v2 in C#

Can anyone share some code in C# How i might go about doing this for a desktop app that needs to access user dropbox accounts

 

many Thanks

 

2 Replies 2

Greg-DB
Dropbox Staff

Using the official Dropbox API 2 .NET SDK, that would look like this:

 

 

var appKey = "<APP KEY>";
var appSecret = "<APP SECRET>";

this.client = new DropboxAppClient(appKey, appSecret);



var oauth1AccessTokenKey = "<OAUTH 1 ACCESS TOKEN KEY>";
var oauth1AccessTokenSecret = "<OAUTH 1 ACCESS TOKEN SECRET>";

var tokenFromOAuth1Result = await this.client.Auth.TokenFromOauth1Async(oauth1AccessTokenKey, oauth1AccessTokenSecret);
Console.WriteLine(tokenFromOAuth1Result.Oauth2Token);

 

AndreCk
Explorer | Level 3

Many Thnaks Greg for your assistance, 😉

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    AndreCk Explorer | Level 3
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?