<?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 Oauth and Curl in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Oauth-and-Curl/m-p/271572#M16079</link>
    <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm developing a backup application which should have a degree of autonomy - configure once and run in the background kind of thing.&amp;nbsp; This is all in C++ with libcurl to do the network side of things.&amp;nbsp; I've been prototyping curl requests using the curl itself (following the examples in &lt;A href="https://www.dropbox.com/developers/documentation/http/overview" target="_blank"&gt;https://www.dropbox.com/developers/documentation/http/overview&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far, everything looks good except for the initial &lt;A href="https://www.dropbox.com/oauth2/authorize" target="_blank"&gt;https://www.dropbox.com/oauth2/authorize&lt;/A&gt;&lt;/P&gt;&lt;P&gt;At the moment, I'm stuck with pasting URLs into a browser to get the initial authorisation token.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, once I have that, then I can manage to get an access token and then upload a file.&lt;/P&gt;&lt;P&gt;How long do access tokens last?&amp;nbsp; Is there an expiry time associated with them?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does the redirect_uri mean I have to provide a functional myapp.com where oauth2/authorize sends the browser (with parameters state=abc&amp;amp;code=xyz).&lt;/P&gt;&lt;P&gt;- Some code on myapp.com then sends a request to &lt;A href="https://www.dropbox.com/oauth2/token" target="_blank"&gt;https://www.dropbox.com/oauth2/token&lt;/A&gt;&lt;/P&gt;&lt;P&gt;- My application on the users' machine then queries myapp.com with state=abc to find out what the access token should be for further api.dropboxapi.com methods.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this is so, does this mean that if myapp.com is down, then users cannot use my application?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was hoping to implement something which only required dropbox to be online.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for any information,&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;</description>
    <pubDate>Wed, 29 May 2019 09:14:07 GMT</pubDate>
    <dc:creator>SteveCr</dc:creator>
    <dc:date>2019-05-29T09:14:07Z</dc:date>
    <item>
      <title>Oauth and Curl</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Oauth-and-Curl/m-p/271572#M16079</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm developing a backup application which should have a degree of autonomy - configure once and run in the background kind of thing.&amp;nbsp; This is all in C++ with libcurl to do the network side of things.&amp;nbsp; I've been prototyping curl requests using the curl itself (following the examples in &lt;A href="https://www.dropbox.com/developers/documentation/http/overview" target="_blank"&gt;https://www.dropbox.com/developers/documentation/http/overview&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far, everything looks good except for the initial &lt;A href="https://www.dropbox.com/oauth2/authorize" target="_blank"&gt;https://www.dropbox.com/oauth2/authorize&lt;/A&gt;&lt;/P&gt;&lt;P&gt;At the moment, I'm stuck with pasting URLs into a browser to get the initial authorisation token.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, once I have that, then I can manage to get an access token and then upload a file.&lt;/P&gt;&lt;P&gt;How long do access tokens last?&amp;nbsp; Is there an expiry time associated with them?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does the redirect_uri mean I have to provide a functional myapp.com where oauth2/authorize sends the browser (with parameters state=abc&amp;amp;code=xyz).&lt;/P&gt;&lt;P&gt;- Some code on myapp.com then sends a request to &lt;A href="https://www.dropbox.com/oauth2/token" target="_blank"&gt;https://www.dropbox.com/oauth2/token&lt;/A&gt;&lt;/P&gt;&lt;P&gt;- My application on the users' machine then queries myapp.com with state=abc to find out what the access token should be for further api.dropboxapi.com methods.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this is so, does this mean that if myapp.com is down, then users cannot use my application?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was hoping to implement something which only required dropbox to be online.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for any information,&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:14:07 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Oauth-and-Curl/m-p/271572#M16079</guid>
      <dc:creator>SteveCr</dc:creator>
      <dc:date>2019-05-29T09:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: Oauth and Curl</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Oauth-and-Curl/m-p/271599#M16082</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/654387"&gt;@SteveCr&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you looked over the information in the Oauth guide here:&lt;BR /&gt;&lt;A href="https://www.dropbox.com/developers/reference/oauth-guide" target="_blank"&gt;https://www.dropbox.com/developers/reference/oauth-guide&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;You're not required to have a redirect URL, but it will change the Oauth flow for your users (they'll get a code they need to pass to your app). This is typically done for desktop or CLI apps - it sounds like from your post of your application runs locally (primarily?) so take a look at the guide and determine which flow is the best for your use case.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tokens, once acquired, won't expire&amp;nbsp;unless you explicitly &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#auth-token-revoke" target="_self"&gt;revoke&lt;/A&gt; them. So after a user completes the flow, and you securely store their token, you would not need to worry about reauthentication. If your intention is to store the tokens in a central location and have&amp;nbsp;your local app query it for the token on startup, your domain would need to be up and active. If you store the token locally, and use the desktop/CLI auth flow then that would not be required.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope that helps,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-Chuck&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Apr 2018 20:30:29 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Oauth-and-Curl/m-p/271599#M16082</guid>
      <dc:creator>chirstius</dc:creator>
      <dc:date>2018-04-06T20:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: Oauth and Curl</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Oauth-and-Curl/m-p/271628#M16086</link>
      <description>&lt;P&gt;Hi Chuck,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dropping the redirect_uri looks like something I can live with for now.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Knowing that the received token is permanent until revoked is a big help, since it's just a one-time setup thing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Steve&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Apr 2018 14:15:07 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Oauth-and-Curl/m-p/271628#M16086</guid>
      <dc:creator>SteveCr</dc:creator>
      <dc:date>2018-04-07T14:15:07Z</dc:date>
    </item>
  </channel>
</rss>

