We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
YanivB
2 years agoHelpful | Level 6
reauthorizeClient
Hi, i get access token in my ios app using dropbox api. i want to reauthenticate in the same app on other device using these access token. How can it be done (in Swift code lang) ? all wo...
- 2 years ago
You are awesome !
Thanks the guidance.
Здравко
2 years agoLegendary | Level 20
Ok, let see what you have already done. When your authentication succeeds, you're receiving DropboxAccessToken object and print it out. This object contains the actual access token, user id, refresh token, and token expiration timestamp. Unfortunately, when just printed (as you have done) it outputs only the access token string and skips everything else (incomplete data, so cannot restore it). Here you should take care to get access to everything as print everything out field by field. Once this got done you're gonna have everything needed (not just a part). I hope you don't need example for printing out of the data.
On the other side (other device), you can use available already data as something like:
let token = DropboxAccessToken(accessToken: accessToken, uid: userId,
refreshToken: refreshToken, tokenExpirationTimestamp: expirationTimestamp)
DropboxOAuthManager.sharedOAuthManager.storeAccessToken(token)Again, you should already have accessToken, userId, refreshToken, and expirationTimestamp. 😉
Hope this helps.
YanivB
2 years agoHelpful | Level 6
Thanks!! now it all working also on the other device.
Last question 😊
As I passed in the
DropboxAccessToken()
the Refresh token also, is that means it will not expires ?
So no additional refresh logic needed?
Thanks again !
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!