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

Forum Discussion

koradev_shane's avatar
koradev_shane
Explorer | Level 3
2 years ago

Node.js server-side auth

Hi,

 

I am building an application using Strapi where users can upload files to the Strapi server (no dropbox needed at this point). Every week, I need to backup the files from the server to dropbox. This should happen without user interaction.

 

How can I authenticate the Node server with my Dropbox app to be able to upload these files? From what I understand of the OAuth flow, user interaction is required to authenticate (visit auth URL, tap Agree/Allow, be redirected with the `code` value in query and then use dbx SDK to getAccessTokenWithCode).


  • koradev_shane wrote:

    ... From what I understand of the OAuth flow, user interaction is required to authenticate (visit auth URL, tap Agree/Allow, be redirected with the `code` value in query and then use dbx SDK to getAccessTokenWithCode).


    Hi koradev_shane,

    Yes, you need to perform OAuth flow least once. It depend is your action is one time action (or multiple times in short period ~4 hours) or need to proceed for longer. If you need one time action - access token generated either from your application page or received with OAuth flow should be enough. If you need access for longer, you need offline access type through refresh token. The OAuth flow itself doesn't need to be performed on your server. You can perform such a flow on the machine you have used to make above post (or any other machine) and use received results on your server without anything like URL, agree etc. there. 😉 Take a look how you can perform simplistic OAuth flow by hand here.

    Hope this helps.

About Discuss Dropbox Developer & API

Node avatar for Discuss Dropbox Developer & API

Make connections with other developers

795 PostsLatest Activity: 7 days ago
192 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!