cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox 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: 

Re: 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?