cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Musicians, convert your MuseScore files to PDF to play music on the go! Learn more 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: 

Cannot refresh short-lived access tokens, node.js

Cannot refresh short-lived access tokens, node.js

dbmt
New member | Level 2

I have a web-app that processes images and uploads them to a single dropbox folder (My account). I have an App for my web app in dropbox and I am successfully able to upload images to said folder. 

The access tokens to the folder expire every four hours, and I am having trouble understanding the OAuth options that will work in my case. It would seem that most options to acquire a new access token requires user input which should not be required if I all I am doing is uploading images.

 

I have tried  using oauth2/token but this requires an authorization code that is limited to one use and will not work in my case.

 

I simply need an access token to my dropbox account that I can refresh whenever the old token has expired. Any direction would be helpful as I am lost.

 

3 Replies 3

dbmt
New member | Level 2

Anyone?

Здравко
Legendary | Level 20

Hi @dbmt,

Take a look here if you want to know how exactly refreshing works. You'll need only the refresh token there though. Initialization of SDK in correct way would be enough.

Hope this helps.

Greg-DB
Dropbox Staff

@dbmt As Здравко indicated, you would need a refresh token to maintain long-term unattended access.

 

Dropbox issues short-lived access tokens, which expire after a few hours, and optional refresh tokens, which don't expire. Apps can get long-term access by requesting "offline" access, in which case the app receives a "refresh token" that can be used to retrieve new short-lived access tokens as needed, without further manual user intervention. Refresh tokens do not expire automatically and can be used repeatedly. You can find more information in the OAuth Guide and authorization documentation. There's a basic outline of processing this flow in this blog post which may serve as a useful example.

 

The official Dropbox SDKs can also handle the refresh process for you automatically. If you're using one of the official Dropbox SDKs, refer to its corresponding documentation and examples for information on how to use it.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Здравко Legendary | Level 20
  • User avatar
    dbmt New member | Level 2
What do Dropbox user levels mean?