The popular node-red-node-dropbox has been around since 2015, and is still popular today.
However some months ago, Dropbox stopped issuing long lived tokens, and moved to an api using short lived tokens instead, which because the node has not been updated resulted in the tokens expiring after about 3hrs, rendering the node, and their flow inoperative. Also, if existing Dropbox users lose their current token, they will face the same problem.
The original author of the node no longer supports it, and it is currently hosted in the node-RED repo, so I am asking if anyone would be willing to take a look, and hopefully update the node to reflect the api change.
I have tried, but TBH, I don't possess the necessary skills, but I have been in contact with a very helpful dropbox techie, who has said;
There isn't some only correct answer to your question. It's matter either of every library' and/or application' design. The correct way depends primarily on how you prefer private info to be handled (any authentication info is a private info).
In your code you are instantiating the client object using access token only. As I mentioned before that's where your issue is coming from.
Take a look here on how actual refresh process appears (from initial authentication to refreshing steps at the end - internally as HTTPS transactions).
As you are using pre-generated credentials (as far as I can see), ordered HTTP calls can be used to get to all needed credential information, not just only access token.
Such information is not accessible through application console as was for long lived access token (not yet, at least). Once you get to all needed credentials, correct client object can be instantiated using correct Dropbox constructor's options (accessTokenExpiresAt, refreshToken, clientId, and clientSecret all in addition to accessToken). That's it.
Hope this casts some extra light.
Add: The only mandatory options to getting refresh process on are refreshToken and clientId, but depending on selected authentication clientSecret may be required too. Others can be useful to optimize the refreshing in some cases (save and reuse).
I have also had an offer of help;
Hi Paul
Thanks for bearing with us as we've been migrating to short-lived tokens!
One thing that might help, you mentioned you've made some attempts at updating your code to use short-lived tokens.
If you have a pull-request or some work done you can post here, we can take a look and might be able to provide more specific guidance.
Despite that kind offer (which is still very much open), again my skills would not present a serious submission, but I have no doubt that any node-RED contributor could accept this offer (I can provide contact details).
If nobody rises to the challenge, the node will probably be deprecated, which will be a loss to node-RED users, also there is no other contrib node that interacts with Dropbox.
Any volunteer?