<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Short lived tokens - node-RED community help needed in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Short-lived-tokens-node-RED-community-help-needed/m-p/610251#M28233</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/422790"&gt;@Здравко&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;I have no idea how you can run the pointed code in browser! &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@9AD39CA637682E9616FBE31CDAF1B6C4/emoticons/1f914.png" alt=":thinking_face:" title=":thinking_face:" /&gt; Did you try? 🧐 To be honest, I can't. Share your experience how you did it. That code is a simple backend application actually. Of course, you can see the application output in a browser, but the application doesn't run in the browser (as far as I know). &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@41457EF40051AFF130FDBFE21B496926/emoticons/1f609.png" alt=":winking_face:" title=":winking_face:" /&gt;.&lt;/BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Sorry, I wasn't clear. Yes, I have tried, but it appears that I run the code, and then I open a browser to `localhost:3000` which then redirects to 2 consecutive pages to authorize access to my app, is there anyway to avoid this authorisation process?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dropboxPic.png" style="width: 360px;"&gt;&lt;img src="https://www.dropboxforum.com/t5/image/serverpage/image-id/30403i2B26319F75826F00/image-size/large?v=v2&amp;amp;px=999" role="button" title="dropboxPic.png" alt="dropboxPic.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 18 Jul 2022 13:06:14 GMT</pubDate>
    <dc:creator>Paul R.17</dc:creator>
    <dc:date>2022-07-18T13:06:14Z</dc:date>
    <item>
      <title>Short lived tokens - node-RED community help needed</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Short-lived-tokens-node-RED-community-help-needed/m-p/609502#M28216</link>
      <description>&lt;P&gt;The node-RED community, which numbers in excess of 30,000 members worldwide have enjoyed using Dropbox via a community contributed node for the past 5 years -&amp;nbsp;&lt;A href="https://github.com/Paul-Reed/node-red-web-nodes/tree/master/dropbox" target="_blank"&gt;https://github.com/Paul-Reed/node-red-web-nodes/tree/master/dropbox&lt;/A&gt;&lt;/P&gt;&lt;P&gt;But now since introducing short lived tokens the app no longer works, breaking users flows, and forcing node-RED users to look at other storage options.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Having read the documentation &amp;amp; seen the examples, we find it overly complicated to implement, and a&amp;nbsp;number of people have tried to update the code to refresh the tokens, but we've repeatedly failed!! (the nodes are community developed &amp;amp; maintained).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Has anyone successfully achieved the transition in a node.js environment, or can help us to update pls.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jul 2022 12:10:41 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Short-lived-tokens-node-RED-community-help-needed/m-p/609502#M28216</guid>
      <dc:creator>Paul R.17</dc:creator>
      <dc:date>2022-07-16T12:10:41Z</dc:date>
    </item>
    <item>
      <title>Re: Short lived tokens - node-RED community help needed</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Short-lived-tokens-node-RED-community-help-needed/m-p/609549#M28217</link>
      <description>&lt;P&gt;Hi &lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/68475"&gt;@Paul R.17&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Take a look on a simplified example &lt;A title="Server javascript" href="https://github.com/dropbox/dropbox-sdk-js/blob/main/examples/javascript/PKCE-backend/code_flow_example.js" target="_blank" rel="noopener"&gt;here&lt;/A&gt;. You can get idea out from there, I believe. In short, new refresh token has to be added so your application can access desired account long term without additional user interaction. By now you are relying to short lived access token only and that's where your issue is coming from. &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@41457EF40051AFF130FDBFE21B496926/emoticons/1f609.png" alt=":winking_face:" title=":winking_face:" /&gt; That's it.&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2022 12:25:03 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Short-lived-tokens-node-RED-community-help-needed/m-p/609549#M28217</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2022-07-14T12:25:03Z</dc:date>
    </item>
    <item>
      <title>Re: Short lived tokens - node-RED community help needed</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Short-lived-tokens-node-RED-community-help-needed/m-p/609556#M28218</link>
      <description>&lt;P&gt;Thanks for replying.&lt;/P&gt;&lt;P&gt;I have already looked at that, but could not understand how/where it would be added to the existing code.&lt;/P&gt;&lt;P&gt;Unfortunately, most of us in the node-RED community are at a lower technical level, and are struggling.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2022 12:46:42 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Short-lived-tokens-node-RED-community-help-needed/m-p/609556#M28218</guid>
      <dc:creator>Paul R.17</dc:creator>
      <dc:date>2022-07-14T12:46:42Z</dc:date>
    </item>
    <item>
      <title>Re: Short lived tokens - node-RED community help needed</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Short-lived-tokens-node-RED-community-help-needed/m-p/609591#M28219</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/68475"&gt;@Paul R.17&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;I have already looked at that, but could not understand how/where it would be added to the existing code.&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Hi again &lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/68475"&gt;@Paul R.17&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@FBF7D2AB59A0D6E861EBF6A36F93B7E2/emoticons/1f642.png" alt=":slightly_smiling_face:" title=":slightly_smiling_face:" /&gt;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). &lt;A href="https://github.com/node-red/node-red-web-nodes/blob/master/dropbox/dropbox.js#L27" target="_blank" rel="noopener"&gt;In your code&lt;/A&gt; 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 &lt;A href="https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-generating-access-token/m-p/592921/highlight/true#M27586" target="_blank" rel="noopener"&gt;here&lt;/A&gt; on how actual refresh process appears (from initial authentication to refreshing steps at the end - internally as HTTPS transactions). As you are using pregenerated 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 &lt;A href="https://github.com/dropbox/dropbox-sdk-js/blob/dcc134dda8d39329c518ba66c2ac1ff187e43bde/src/auth.js#L69" target="_blank" rel="noopener"&gt;options&lt;/A&gt; (accessTokenExpiresAt, refreshToken, clientId, and clientSecret all in addition to accessToken). &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@41457EF40051AFF130FDBFE21B496926/emoticons/1f609.png" alt=":winking_face:" title=":winking_face:" /&gt; That's it.&lt;/P&gt;&lt;P&gt;Hope this casts some extra light.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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).&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2022 15:09:41 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Short-lived-tokens-node-RED-community-help-needed/m-p/609591#M28219</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2022-07-14T15:09:41Z</dc:date>
    </item>
    <item>
      <title>Re: Short lived tokens - node-RED community help needed</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Short-lived-tokens-node-RED-community-help-needed/m-p/609694#M28220</link>
      <description>&lt;P&gt;Hi Paul,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for bearing with us as we've been migrating to short-lived tokens!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2022 23:31:32 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Short-lived-tokens-node-RED-community-help-needed/m-p/609694#M28220</guid>
      <dc:creator>Scott-DB</dc:creator>
      <dc:date>2022-07-14T23:31:32Z</dc:date>
    </item>
    <item>
      <title>Re: Short lived tokens - node-RED community help needed</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Short-lived-tokens-node-RED-community-help-needed/m-p/609916#M28222</link>
      <description>&lt;P&gt;Thanks for the kind offer&amp;nbsp;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1519256"&gt;@Scott-DB&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, not quite at that stage yet, but probably (very likely!) I'll take you up on that offer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Meanwhile, most of the example SDK's relate to browser based apps. Is there a javascript SDK/example that is suitable for back-end applications that I could use to obtain the token?&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jul 2022 21:25:58 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Short-lived-tokens-node-RED-community-help-needed/m-p/609916#M28222</guid>
      <dc:creator>Paul R.17</dc:creator>
      <dc:date>2022-07-15T21:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: Short lived tokens - node-RED community help needed</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Short-lived-tokens-node-RED-community-help-needed/m-p/609989#M28225</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/422790"&gt;@Здравко&lt;/a&gt;&amp;nbsp;I tried your &lt;A href="https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-generating-access-token/m-p/592921/highlight/true#M27586" target="_blank" rel="noopener"&gt;demo link to create a token&lt;/A&gt; which worked fine, and produced a valid (short life) token which enabled the node-RED node to work OK.&lt;/P&gt;&lt;P&gt;But could you clarify &lt;A href="https://github.com/dropbox/dropbox-sdk-js/blob/main/examples/javascript/PKCE-backend/code_flow_example.js" target="_blank" rel="noopener"&gt;this link which you posted earlier&lt;/A&gt;&amp;nbsp;as it appears to be an example for use with browser apps, and not for a back-end app which run without user intervention. Is this the correct example for me to follow?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jul 2022 12:03:19 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Short-lived-tokens-node-RED-community-help-needed/m-p/609989#M28225</guid>
      <dc:creator>Paul R.17</dc:creator>
      <dc:date>2022-07-16T12:03:19Z</dc:date>
    </item>
    <item>
      <title>Re: Short lived tokens - node-RED community help needed</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Short-lived-tokens-node-RED-community-help-needed/m-p/610010#M28230</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/68475"&gt;@Paul R.17&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/422790"&gt;@Здравко&lt;/a&gt;&amp;nbsp;I tried your &lt;A href="https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-generating-access-token/m-p/592921/highlight/true#M27586" target="_blank" rel="noopener"&gt;demo link to create a token&lt;/A&gt; which worked fine, and produced a valid (short life) token which enabled the node-RED node to work OK.&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Hi &lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/68475"&gt;@Paul R.17&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Not only short lived token, but all needed to use refresh process.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/68475"&gt;@Paul R.17&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;But could you clarify &lt;A href="https://github.com/dropbox/dropbox-sdk-js/blob/main/examples/javascript/PKCE-backend/code_flow_example.js" target="_blank" rel="noopener"&gt;this link which you posted earlier&lt;/A&gt;&amp;nbsp;as it appears to be an example for use with browser apps, and not for a back-end app which run without user intervention. Is this the correct example for me to follow?&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I have no idea how you can run the pointed code in browser! &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@9AD39CA637682E9616FBE31CDAF1B6C4/emoticons/1f914.png" alt=":thinking_face:" title=":thinking_face:" /&gt; Did you try? 🧐 To be honest, I can't. Share your experience how you did it. That code is a simple backend application actually. Of course, you can see the application output in a browser, but the application doesn't run in the browser (as far as I know). &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@41457EF40051AFF130FDBFE21B496926/emoticons/1f609.png" alt=":winking_face:" title=":winking_face:" /&gt;&lt;/P&gt;&lt;P&gt;Hope this cast additional light.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jul 2022 17:03:45 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Short-lived-tokens-node-RED-community-help-needed/m-p/610010#M28230</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2022-07-16T17:03:45Z</dc:date>
    </item>
    <item>
      <title>Re: Short lived tokens - node-RED community help needed</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Short-lived-tokens-node-RED-community-help-needed/m-p/610251#M28233</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/422790"&gt;@Здравко&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;I have no idea how you can run the pointed code in browser! &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@9AD39CA637682E9616FBE31CDAF1B6C4/emoticons/1f914.png" alt=":thinking_face:" title=":thinking_face:" /&gt; Did you try? 🧐 To be honest, I can't. Share your experience how you did it. That code is a simple backend application actually. Of course, you can see the application output in a browser, but the application doesn't run in the browser (as far as I know). &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@41457EF40051AFF130FDBFE21B496926/emoticons/1f609.png" alt=":winking_face:" title=":winking_face:" /&gt;.&lt;/BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Sorry, I wasn't clear. Yes, I have tried, but it appears that I run the code, and then I open a browser to `localhost:3000` which then redirects to 2 consecutive pages to authorize access to my app, is there anyway to avoid this authorisation process?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dropboxPic.png" style="width: 360px;"&gt;&lt;img src="https://www.dropboxforum.com/t5/image/serverpage/image-id/30403i2B26319F75826F00/image-size/large?v=v2&amp;amp;px=999" role="button" title="dropboxPic.png" alt="dropboxPic.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2022 13:06:14 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Short-lived-tokens-node-RED-community-help-needed/m-p/610251#M28233</guid>
      <dc:creator>Paul R.17</dc:creator>
      <dc:date>2022-07-18T13:06:14Z</dc:date>
    </item>
    <item>
      <title>Re: Short lived tokens - node-RED community help needed</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Short-lived-tokens-node-RED-community-help-needed/m-p/610262#M28234</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/68475"&gt;@Paul R.17&lt;/a&gt;&amp;nbsp;wrote:&lt;P&gt;... Yes, I have tried, but it appears that I run the code, and then I open a browser to `localhost:3000` which then redirects to 2 consecutive pages to authorize access to my app, is there anyway to avoid this authorisation process?&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;If you mean to avoid it completely - No (not yet, at least). If you mean embed pre-generated authorization info (like long lived token before) - Yes - that's why I pointed to procedure where you had seen generated short lived access token only, but there are all needed components, including refresh token. Using pre-generated authorization info, you will not need to process authorization within the application, if that's what you are asking for. Remove authorization code from your application and put there (on its out) already generated information (ready for use). Before (at time of&amp;nbsp; long lived token) was the same choice pre-generated token or authorization within the application, so nothing new. The only limitation now (something probably confusing your) is missing single button for getting such information, as was before (that's why you cannot avoid it completely yet - this might change in future,&amp;nbsp; but better don't rely).&amp;nbsp;&lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@41457EF40051AFF130FDBFE21B496926/emoticons/1f609.png" alt=":winking_face:" title=":winking_face:" /&gt; That's it.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2022 13:29:54 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Short-lived-tokens-node-RED-community-help-needed/m-p/610262#M28234</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2022-07-18T13:29:54Z</dc:date>
    </item>
  </channel>
</rss>

