We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
d3c0y
9 years agoExplorer | Level 3
Migrating access token from API v1 to v2
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
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?
4 Replies
- Stephen C.149 years ago
Dropbox Staff
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!
- d3c0y9 years agoExplorer | 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 ...
- Stephen C.149 years ago
Dropbox Staff
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?
- d3c0y9 years agoExplorer | Level 3Ah, 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!
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!