<?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: can't authenticate with javascript in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/can-t-authenticate-with-javascript/m-p/6583#M255</link>
    <description>&lt;P&gt;The code I see here should all work once authentication has been started, but I don't see a call to start authentication.&lt;/P&gt;

&lt;P&gt;Somewhere (e.g. on a button click) should be a call to &lt;CODE&gt;client.authenticate(function (error) { ... });&lt;/CODE&gt; (no &lt;CODE&gt;{ interactive: false }&lt;/CODE&gt;). That will start the authentication flow, and then when the user returns to the page, your existing code should finish the auth process.&lt;/P&gt;

&lt;P&gt;For an example, see &lt;A href="https://www.dropbox.com/developers/datastore/tutorial/js#linking-accounts" rel="nofollow noreferrer"&gt;https://www.dropbox.com/developers/datastore/tutorial/js#linking-accounts&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Wed, 24 Dec 2014 18:43:12 GMT</pubDate>
    <dc:creator>Steve M.</dc:creator>
    <dc:date>2014-12-24T18:43:12Z</dc:date>
    <item>
      <title>can't authenticate with javascript</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/can-t-authenticate-with-javascript/m-p/6582#M254</link>
      <description>&lt;P&gt;I try to use the datastore API with javascript. This is my Code:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
    &amp;lt;head&amp;gt;
        &amp;lt;meta content="text/html; charset=UTF-8" http-equiv="Content-Type"&amp;gt;
        &amp;lt;meta charset="UTF-8"&amp;gt;
    &amp;lt;/head&amp;gt;
    &amp;lt;body&amp;gt;

        &amp;lt;script src="https://www.dropbox.com/static/api/dropbox-datastores-1.2-latest.js" type="text/javascript"&amp;gt;&amp;lt;/script&amp;gt;
        &amp;lt;script&amp;gt;
            var client = new Dropbox.Client({key: 'xxxxxxxxxxxx' });

            // Try to finish OAuth authorization.
            client.authenticate({interactive: false}, function (error) {
                if (error) {
                    alert('Authentication error: ' + error);
                }
            });

            alert(client.isAuthenticated());

            if (client.isAuthenticated()) {
                // Client is authenticated. Display UI.
            }
        &amp;lt;/script&amp;gt;
    &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The line alert(client.isAuthenticated()); always gives false which means that something went wrong with the authentication. Can someon tell me what I'm doing wrong?&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:46:41 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/can-t-authenticate-with-javascript/m-p/6582#M254</guid>
      <dc:creator>Hein B.</dc:creator>
      <dc:date>2019-05-29T09:46:41Z</dc:date>
    </item>
    <item>
      <title>Re: can't authenticate with javascript</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/can-t-authenticate-with-javascript/m-p/6583#M255</link>
      <description>&lt;P&gt;The code I see here should all work once authentication has been started, but I don't see a call to start authentication.&lt;/P&gt;

&lt;P&gt;Somewhere (e.g. on a button click) should be a call to &lt;CODE&gt;client.authenticate(function (error) { ... });&lt;/CODE&gt; (no &lt;CODE&gt;{ interactive: false }&lt;/CODE&gt;). That will start the authentication flow, and then when the user returns to the page, your existing code should finish the auth process.&lt;/P&gt;

&lt;P&gt;For an example, see &lt;A href="https://www.dropbox.com/developers/datastore/tutorial/js#linking-accounts" rel="nofollow noreferrer"&gt;https://www.dropbox.com/developers/datastore/tutorial/js#linking-accounts&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Dec 2014 18:43:12 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/can-t-authenticate-with-javascript/m-p/6583#M255</guid>
      <dc:creator>Steve M.</dc:creator>
      <dc:date>2014-12-24T18:43:12Z</dc:date>
    </item>
    <item>
      <title>Re: can't authenticate with javascript</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/can-t-authenticate-with-javascript/m-p/6584#M256</link>
      <description>&lt;P&gt;Why should I use a button to authenticate? I copied the code from the page that you have linked to and it should work fine. Do I have to do anything else to start authentication or does it suffice to call the method call client.authenticate?&lt;/P&gt;</description>
      <pubDate>Wed, 24 Dec 2014 19:57:49 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/can-t-authenticate-with-javascript/m-p/6584#M256</guid>
      <dc:creator>Hein B.</dc:creator>
      <dc:date>2014-12-24T19:57:49Z</dc:date>
    </item>
    <item>
      <title>Re: can't authenticate with javascript</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/can-t-authenticate-with-javascript/m-p/6585#M257</link>
      <description>&lt;P&gt;You don't need to call &lt;CODE&gt;client.authenticate&lt;/CODE&gt; from a button handler (unless you're using a popup, which will get blocked unless invoked from a user action), but it's the typical way to build an app.&lt;/P&gt;

&lt;P&gt;You don't need to do anything other than call &lt;CODE&gt;client.authenticate&lt;/CODE&gt; (without &lt;CODE&gt;{ interactive: false }&lt;/CODE&gt;) to start the authentication process. I'd suggest following the tutorial exactly until you get working code.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Dec 2014 20:04:31 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/can-t-authenticate-with-javascript/m-p/6585#M257</guid>
      <dc:creator>Steve M.</dc:creator>
      <dc:date>2014-12-24T20:04:31Z</dc:date>
    </item>
  </channel>
</rss>

