# How to use node-red-node-dropbox without a browser?

**URL:** <https://discourse.nodered.org/t/how-to-use-node-red-node-dropbox-without-a-browser/83435>\
**Category:** General\
**Created:** [5 December 2023 13:10 UTC](https://discourse.nodered.org/t/how-to-use-node-red-node-dropbox-without-a-browser/83435 "2023-12-05T13:10:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![georgevbsantiago](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/georgevbsantiago/32/69358_2.png) [@georgevbsantiago](https://discourse.nodered.org/u/georgevbsantiago)\
**Post date:** [5 December 2023 13:10 UTC](https://discourse.nodered.org/t/how-to-use-node-red-node-dropbox-without-a-browser/83435/1 "2023-12-05T13:10:41Z")

</div>

Hello,

How can I use 'node-red-node-dropbox' without a browser on localhost?  
I use a NodeRed instance in which I do not have access to the browser to perform steps to obtain the 'Access Code' and the 'Refresh Token'.

I read several topics about 'node-red-node-dropbox', but the examples are using the browser to obtain the 'Access Code' and the 'Refresh Token'. But how do I get the 'Access Code' and 'Refresh Token' without access to the browser?

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [5 December 2023 13:53 UTC](https://discourse.nodered.org/t/how-to-use-node-red-node-dropbox-without-a-browser/83435/2 "2023-12-05T13:53:23Z")

</div>

Hi @georgevbsantiago, welcome to the forum.

Is there any reason to believe that you must obtain a token on the same machine as runs Node-red?  
Since you must be able access your Node-red instance with a browser from _somewhere_, does that not let you set up the token?

Have you tried obtaining one using a completely seperate PC and browser and copying the values manually into Node-red?

---

<div class="post-metadata">

**Author:** ![georgevbsantiago](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/georgevbsantiago/32/69358_2.png) [@georgevbsantiago](https://discourse.nodered.org/u/georgevbsantiago)\
**Post date:** [5 December 2023 23:25 UTC](https://discourse.nodered.org/t/how-to-use-node-red-node-dropbox-without-a-browser/83435/3 "2023-12-05T23:25:57Z")

</div>

Hello, Thanks for the posts

I read some posts about node-red-node-dropbox (mentioned below) and understood that access via oauth2 token would have to be done on the same machine that generates it.  
Ex: If NodeRed (node-red-node-dropbox) is on VPS 'A', the oauth2 token would have to be generated in the browser of VPS 'A' instance to work.

> [@tada Refresh tokens in node-red-node-dropbox (Now published as v2.0.0)](https://discourse.nodered.org/t/refresh-tokens-in-node-red-node-dropbox-now-published-as-v2-0-0/65610/10):
>
> To get it working on my raspi, I had to open the browser in the raspi because only local is allowed to get my Refresh Token. Since everything was set up locally, I was able to back up again from mac safari.

> [@tada Refresh tokens in node-red-node-dropbox (Now published as v2.0.0)](https://discourse.nodered.org/t/refresh-tokens-in-node-red-node-dropbox-now-published-as-v2-0-0/65610/11):
>
> I wasn't aware that only local was allowed. Will need to to find some time in the weekend to try this myself. Thanks for testing this!!!!

> [@tada Refresh tokens in node-red-node-dropbox (Now published as v2.0.0)](https://discourse.nodered.org/t/refresh-tokens-in-node-red-node-dropbox-now-published-as-v2-0-0/65610/15):
>
> As @Frida already experienced, the hostname in the dropbox redirect\_uri must match the hostname used to access the flow editor.
> 
> 1. If you want to use _ **localhost** _ in your redirect\_uri, then you need to use the browser that is installed on that host. Because the browser installed e.g. on a raspberry, can access local resources on that same raspberry via localhost.
> 2. But normally if you access your flow editor via `https://my_rpi_name:1880/some_path`, then the redirect uri should be `https://my_rpi_name:1880/dropbox /authenticate`
> 
> Am I correct that there is only a problem for Node-RED systems that fulfill the following 2 conditions:
> 
> 1. The system is **not** accessible via localhost, because there is no browser installed on that host.
> 2. And SSL is _ **not** _ enabled (via the Node-RED settings.js file.
> 
> Because dropbox requires https, unless you use localhost.
> 
> Not sure if there is anything I could do about that, to be honest...

I understood that if the user manipulated NodeRed (node-red-node-dropbox) on VPS 'A', but tried to create the token on their personal computer (notebook, PC...), it would not work.

If it is possible to manipulate NodeRed (node-red-node-dropbox) on VPS 'A', and create the token on my notebook to later insert it into node-red-node-dropbox) on VPS 'A', then that's great!

Question: Is there no way to avoid manually creating the oauth2 token by opening Dropbox through the browser?  
I upload it to Dropbox via script, using the access token (old way), using the SDK-Dropbox JavaScript and just providing 'token' and 'account\_id', without prior access via the browser.

Thank you for your attention

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [5 December 2023 23:37 UTC](https://discourse.nodered.org/t/how-to-use-node-red-node-dropbox-without-a-browser/83435/4 "2023-12-05T23:37:05Z")

</div>

OK, I read the post you linked to but didn't understand it all (and not just the Portuguese!).  
Maybe someone else more knowledgable can assist you.

---

<div class="post-metadata">

**Author:** ![georgevbsantiago](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/georgevbsantiago/32/69358_2.png) [@georgevbsantiago](https://discourse.nodered.org/u/georgevbsantiago)\
**Post date:** [5 December 2023 23:58 UTC](https://discourse.nodered.org/t/how-to-use-node-red-node-dropbox-without-a-browser/83435/5 "2023-12-05T23:58:34Z")

</div>

I managed to generate the refresh token through my browser (laptop) and inserted it into node-red-node-dropbox. Thanks.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [19 December 2023 23:59 UTC](https://discourse.nodered.org/t/how-to-use-node-red-node-dropbox-without-a-browser/83435/6 "2023-12-19T23:59:11Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
