cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Back again with another edition of 'How we use Dropbox', so find out how Emma uses to-do lists to get it all done 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

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

Greg-DB
Dropboxer

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);

 

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

AndreCk
Explorer | Level 3

Many Thnaks Greg for your assistance, 😉

Poll
We love to learn from the educators who use Dropbox. Whether you teach kids, teens, adults or a combination of all three, we want to know what apps and integrations you use with Dropbox to help with teaching. Which of the ones below is your favorite, or most used tool?
Who's talking

Top contributors to this post

  • User avatar
    AndreCk Explorer | Level 3
  • User avatar
    Greg-DB Dropboxer
What do Dropbox user levels mean?
Need more support?