We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.

Forum Discussion

morkus's avatar
morkus
Helpful | Level 5
3 years ago

How to automate getting a new token using Java?

Now that DB uses "short-lived" tokens, I am having trouble "automating" token refresh within an application.

 

Using the Java code examples, I can get the DB URL where I manually have to log into the DB site, get the new access code, and, again, manually, copy that back to the application (

.ShortLiveTokenAuthorize().authorize(appInfo);

So, my question is ... is there a way to get the new access token programmatically with NO manual steps? So, when the user goes to "upload" (in my case), it ... ALWAYS works;

 

Using OAUTH in other apps I can automated refreshing the token, but I haven't seen an example how to do it with DB.

 

Thanks in advance!

  • Yes, that's correct. The SDK client knows how to use the credentials (refresh token, app key, and for the non-PKCE case, app secret) to automatically perform the refresh process whenever needed, so that calls continue to work.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,877 PostsLatest Activity: 12 months ago
325 Following

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

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!