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: Migrating access token from API v1 to v2

Migrating access token from API v1 to v2

d3c0y
Explorer | Level 3
Go to solution

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

Stephen C.14
Dropbox Staff
Go to solution

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

Stephen C.14
Dropbox Staff
Go to solution

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!

d3c0y
Explorer | Level 3
Go to solution

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 ...

Stephen C.14
Dropbox Staff
Go to solution

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?

d3c0y
Explorer | Level 3
Go to solution
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!
Need more support?