<?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: Keep getting new access token in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Keep-getting-new-access-token/m-p/278150#M16659</link>
    <description>&lt;P&gt;If the user is authorizing for the first time, the inappbrowser in Cordova opens the dropbox login web address which allows the user to login and authorize the app, which returns an access token.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But if the button is pressed again, the inappbrowser would open momentarily and then close immediately and return the new access token.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So to a user a blank screen is shown for 1-2 seconds, then it closes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 29 May 2018 19:29:20 GMT</pubDate>
    <dc:creator>good_boy</dc:creator>
    <dc:date>2018-05-29T19:29:20Z</dc:date>
    <item>
      <title>Keep getting new access token</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Keep-getting-new-access-token/m-p/278021#M16644</link>
      <description>&lt;P&gt;I can successfully authenticate Dropbox in my Phonegap app the first time, but I keep getting a new one if the button is pressed again, why is that? Shouldn't it return the same token again?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And there is a blank screen which appears. I have seen many dirty solution to change the inappbrowser.js code itself. this is problematic, since the plugin can't be edited if I have to compile the app for multiple platforms from an online build service.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is your suggestion for a proper implementation, where authorization happens only once if successful and stored indefinitely in the app without concern if the app cache is cleared by user and a blank page is also not displayed?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At present I have this basic implementation, in index.html&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;button onclick="authenticateWithCordova()"&amp;gt;Authenticate&amp;lt;/button&amp;gt;&lt;BR /&gt;&amp;lt;script&amp;gt;&lt;BR /&gt;function authenticateWithCordova()
        {
            var dbx = new window.Dropbox.Dropbox({ clientId: 'xxxxxxxxxx' });
            dbx.authenticateWithCordova(AuthSuccess,AuthFail);

        }

        function AuthSuccess(accessToken)
        {   
            localStorage.accessToken = accessToken;
            console.log(accessToken);
        }

        function AuthFail()
        {
        alert("Auth Fail"); 
        }&lt;BR /&gt;&amp;lt;/script&amp;gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 May 2019 09:13:01 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Keep-getting-new-access-token/m-p/278021#M16644</guid>
      <dc:creator>good_boy</dc:creator>
      <dc:date>2019-05-29T09:13:01Z</dc:date>
    </item>
    <item>
      <title>Re: Keep getting new access token</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Keep-getting-new-access-token/m-p/278128#M16657</link>
      <description>&lt;P&gt;You are not supposed to get the same access token on different app authorizations. Each time you go through the flow, you will get a different one. You generally should store and re-use the access token you get so that the user doesn't have to process the app authorization flow every time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you elaborate on the issue you're referring to when you mention the "blank screen"?&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2018 15:07:32 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Keep-getting-new-access-token/m-p/278128#M16657</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-05-29T15:07:32Z</dc:date>
    </item>
    <item>
      <title>Re: Keep getting new access token</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Keep-getting-new-access-token/m-p/278150#M16659</link>
      <description>&lt;P&gt;If the user is authorizing for the first time, the inappbrowser in Cordova opens the dropbox login web address which allows the user to login and authorize the app, which returns an access token.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But if the button is pressed again, the inappbrowser would open momentarily and then close immediately and return the new access token.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So to a user a blank screen is shown for 1-2 seconds, then it closes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2018 19:29:20 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Keep-getting-new-access-token/m-p/278150#M16659</guid>
      <dc:creator>good_boy</dc:creator>
      <dc:date>2018-05-29T19:29:20Z</dc:date>
    </item>
    <item>
      <title>Re: Keep getting new access token</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Keep-getting-new-access-token/m-p/278154#M16660</link>
      <description>Thanks! It sounds like you're referring to the behavior of the Dropbox OAuth app authorization flow where, if the user has already authorized your app, then they may be automatically redirected back to your app instead of having to provide explicit authorization again. (This is when the browser would presented&amp;nbsp;momentarily, but then would be automatically dismissed since the authorization flow automatically completed.) If the user fully revokes the app's authorization, e.g., via &lt;A href="https://www.dropbox.com/account/security" target="_blank"&gt;https://www.dropbox.com/account/security&lt;/A&gt; , though, then they will not be automatically redirected.&lt;BR /&gt;&lt;BR /&gt;Apps can also control this behavior using the 'force_reapprove' parameter on /authorize:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#oauth2-authorize" target="_blank"&gt;https://www.dropbox.com/developers/documentation/http/documentation#oauth2-authorize&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;This isn't currently implemented in the official JavaScript SDK, but I'll be sure to pass this along as a feature request.</description>
      <pubDate>Tue, 29 May 2018 20:16:33 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Keep-getting-new-access-token/m-p/278154#M16660</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-05-29T20:16:33Z</dc:date>
    </item>
  </channel>
</rss>

