We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
yurpub
4 years agoNew member | Level 2
Dropbox Sdk refresh access token encapsulated
Hi guys,
your Sdk is great, however I don't understand something.
Inside I found a method CheckAndRefreshAccessToken(), that in turn calls RefreshAccessToken() that retrieves new access a...
Здравко
4 years agoLegendary | Level 20
Hi yurpub,
You didn't clarify what SDK and what version you are referring to.
Generally talking when you have got refresh token you don't mandatory need anything else. Depending on which SDK you are using, there is some way to build new client object with the owned refresh token and dummy other arguments (when they are needed). If new client object is going to be constructed relatively often, you can keep your old access token and expiration time and reuse them. This can be done without accessing any internal code/data. There is usually some authentication object you can serialize to and restore from data stream. 😉
Hope this helps.
yurpub
4 years agoNew member | Level 2
Dropbox.Api v. 6.29.
Constructor of DropboxClient accepts access and refresh tokens, expiration date.
When connecting a DB account, I'm able to store an access & refresh tokens + expiration from DropboxOAuth2Helper.ProcessCodeFlowAsync(). Great!
When an access token expires, the Sdk takes care of this by refreshing the token and setting it in DropboxRequestHandlerOptions instance. Great! But how do I access it? 🤔
I now need to create DropboxClient class again. Supplying the old access token+expiration doesn't make sense. Although it'll work because Sdk will make a call to refresh a token. Means, it's going to refresh token every time we want to access a client's account.
Would you please share an example of how to access new access token and expiration date?
About Discuss Dropbox Developer & API
Make connections with 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!