<?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: Problems with the short-lived token for my App in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Problems-with-the-short-lived-token-for-my-App/m-p/727414#M32175</link>
    <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1763726"&gt;@rafaelbelda&lt;/a&gt;&amp;nbsp;Здравко is correct; for long-term access you should use a refresh token. Refresh tokens do not expire and can be used repeatedly. You do not need to re-authorize the app each time. Once you have a refresh token you can store and re-use that refresh token without further manual action.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The &lt;A href="https://github.com/dropbox/dropbox-sdk-python" target="_blank"&gt;official Dropbox Python SDK&lt;/A&gt; will handle the details of how to use a refresh token for you, so you would just need to make the Dropbox client object like this, if you used PKCE to retrieve the refresh token:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;dropbox.Dropbox(oauth2_refresh_token=REFRESH_TOKEN, app_key=APP_KEY)&lt;/LI-CODE&gt;
&lt;P&gt;or like this, if you did not use PKCE to retrieve the refresh token:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;dropbox.Dropbox(oauth2_refresh_token=REFRESH_TOKEN, app_key=APP_KEY, app_secret=APP_SECRET)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For reference, you can find more information on how this works at the following resources:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://developers.dropbox.com/oauth-guide" target="_blank"&gt;https://developers.dropbox.com/oauth-guide&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#authorization" target="_blank"&gt;https://www.dropbox.com/developers/documentation/http/documentation#authorization&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://dropbox.tech/developers/using-oauth-2-0-with-offline-access" target="_blank"&gt;https://dropbox.tech/developers/using-oauth-2-0-with-offline-access&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 06 Nov 2023 16:06:28 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2023-11-06T16:06:28Z</dc:date>
    <item>
      <title>Problems with the short-lived token for my App</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Problems-with-the-short-lived-token-for-my-App/m-p/727234#M32168</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I am making a python script that downloads all the files in a Apps folder that I set up for this specific reason. The script is ment to keep me and my friends updated in our workflow. However, after a while, the App token expired and we lost access to the folder; with a bit of research I found out that Dropbox is no longer using permanent tokens and migrated to short-lived tokens and a optional refresh token w/ oauth2.&lt;BR /&gt;&lt;BR /&gt;I am very confused on how to keep the connection alive and from the tutorials that I've watched on YouTube, it looks way to complicated for a simple script, because of this I am even considering changing services and trying to find a easier option. I've never worked with oauth2 before if you haven't guessed already, do I really need to authenticate every time to get the token? I really don't want 50% of my code being just the auth process.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;That's lliterally what I was using to connect to DB with the short-lived token:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;def&lt;/SPAN&gt; &lt;SPAN&gt;getDropbox&lt;/SPAN&gt;&lt;SPAN&gt;():&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;dbx_token&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;open&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;os&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;path&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;join&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;path_config&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;"dropbox_token.txt"&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;"r"&lt;/SPAN&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;SPAN&gt;read&lt;/SPAN&gt;&lt;SPAN&gt;()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;return&lt;/SPAN&gt; &lt;SPAN&gt;dropbox&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Dropbox&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;dbx_token&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;I know there are security risks involved in a permanent token but this is just a quick fix for something that doesn't need to be that secured. I just wanted that my script could always download that files everytime without having to manually generate a new token.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thank you if you have the time to answer. Also, sorry for any English/code knowledge mistakes, I just program for fun&amp;nbsp; &amp;nbsp; = )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- Rafael&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2023 01:39:04 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Problems-with-the-short-lived-token-for-my-App/m-p/727234#M32168</guid>
      <dc:creator>rafaelbelda</dc:creator>
      <dc:date>2023-11-06T01:39:04Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with the short-lived token for my App</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Problems-with-the-short-lived-token-for-my-App/m-p/727244#M32170</link>
      <description>&lt;P&gt;In a very similar way, just instead of single access token, use refresh token and application key/secret for the client object initialization. Everything else can stay the same.&lt;/P&gt;&lt;P&gt;Hope this gives direction.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2023 03:48:37 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Problems-with-the-short-lived-token-for-my-App/m-p/727244#M32170</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2023-11-06T03:48:37Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with the short-lived token for my App</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Problems-with-the-short-lived-token-for-my-App/m-p/727414#M32175</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1763726"&gt;@rafaelbelda&lt;/a&gt;&amp;nbsp;Здравко is correct; for long-term access you should use a refresh token. Refresh tokens do not expire and can be used repeatedly. You do not need to re-authorize the app each time. Once you have a refresh token you can store and re-use that refresh token without further manual action.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The &lt;A href="https://github.com/dropbox/dropbox-sdk-python" target="_blank"&gt;official Dropbox Python SDK&lt;/A&gt; will handle the details of how to use a refresh token for you, so you would just need to make the Dropbox client object like this, if you used PKCE to retrieve the refresh token:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;dropbox.Dropbox(oauth2_refresh_token=REFRESH_TOKEN, app_key=APP_KEY)&lt;/LI-CODE&gt;
&lt;P&gt;or like this, if you did not use PKCE to retrieve the refresh token:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;dropbox.Dropbox(oauth2_refresh_token=REFRESH_TOKEN, app_key=APP_KEY, app_secret=APP_SECRET)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For reference, you can find more information on how this works at the following resources:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://developers.dropbox.com/oauth-guide" target="_blank"&gt;https://developers.dropbox.com/oauth-guide&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#authorization" target="_blank"&gt;https://www.dropbox.com/developers/documentation/http/documentation#authorization&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://dropbox.tech/developers/using-oauth-2-0-with-offline-access" target="_blank"&gt;https://dropbox.tech/developers/using-oauth-2-0-with-offline-access&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2023 16:06:28 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Problems-with-the-short-lived-token-for-my-App/m-p/727414#M32175</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2023-11-06T16:06:28Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with the short-lived token for my App</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Problems-with-the-short-lived-token-for-my-App/m-p/727564#M32178</link>
      <description>Thank you for replying and for the direction, I will try to integrate that tomorrow and I will get back with the solution.</description>
      <pubDate>Tue, 07 Nov 2023 03:42:55 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Problems-with-the-short-lived-token-for-my-App/m-p/727564#M32178</guid>
      <dc:creator>rafaelbelda</dc:creator>
      <dc:date>2023-11-07T03:42:55Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with the short-lived token for my App</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Problems-with-the-short-lived-token-for-my-App/m-p/727565#M32179</link>
      <description>&lt;P&gt;Thank you for the extra detail, that was easier than I thought it was; I will try that later. Appreciate the help.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2023 03:45:50 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Problems-with-the-short-lived-token-for-my-App/m-p/727565#M32179</guid>
      <dc:creator>rafaelbelda</dc:creator>
      <dc:date>2023-11-07T03:45:50Z</dc:date>
    </item>
  </channel>
</rss>

