cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Are you an educator? Well we want to hear from you, so check out some tools we think might help you out 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: 

Migrating access token from API v1 to v2

Migrating access token from API v1 to v2

d3c0y
Explorer | Level 3

Hi,

 

I was using Java SDK v1.7 and have stored access tokens of my users in database. I realized that I need to have access token key and access token secret when I wanted to automatically upgrade access tokens to v2.

But I do not know how to get those access token secrets. I am not aware that SDK v1 was providing such functionality to get both values, only access token.

 

DbxAuthFinish contains method getAccessToken to get only access token. And it was the last step when doing oauth dance.

 

Can you suggest me how to continue with the migration, please?

 

Thanks

1 Accepted Solution

Accepted Solutions

Re: Migrating access token from API v1 to v2

Stephen C.14
Dropboxer

Ah, I see. If you have been using the `getAccessToken()` method for access tokens, then you do not need to perform a token migration, as you are already using OAuth 2.0 tokens, which work for both API v1 and API v2.

 

Is this the case for you?

View solution in original post

4 Replies 4

Re: Migrating access token from API v1 to v2

Stephen C.14
Dropboxer

Thanks for reaching out. I would recommend taking a look at the DbxOAuth1Upgrader class, which allows you to migrate OAuth 1.0 tokens to OAuth 2.0 tokens.

 

In OAuth 2.0, there is no access token secret, only an access token.

 

Please let me know if you have additional questions. Thank you!

Re: Migrating access token from API v1 to v2

d3c0y
Explorer | Level 3

I can see method:

String createOAuth2AccessToken(DbxOAuth1AccessToken token)

 which takes access token object of version 1 but when you want to create the object you have to pass to the constructor:

  • key
  • secret
public DbxOAuth1AccessToken(String key, String secret)

  and I do not have secret ...

Re: Migrating access token from API v1 to v2

Stephen C.14
Dropboxer

Ah, I see. If you have been using the `getAccessToken()` method for access tokens, then you do not need to perform a token migration, as you are already using OAuth 2.0 tokens, which work for both API v1 and API v2.

 

Is this the case for you?

View solution in original post

Re: Migrating access token from API v1 to v2

d3c0y
Explorer | Level 3
Ah, you are right. I was little bit confused with the v2 of API ... I thought there is also a change in the OAuth.

Thank you!
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
    d3c0y Explorer | Level 3
  • User avatar
    Stephen C.14 Dropboxer
What do Dropbox user levels mean?
Need more support?