<?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 Safely expose credentials to JavaScript client? in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Safely-expose-credentials-to-JavaScript-client/m-p/169343#M6248</link>
    <description>&lt;P&gt;I'm building an application with Dropbox that allows the user to log in with Dropbox using OAuth 2. I've made an app on Dropbox, put the app key and app secret into my application code, and I can successfully authenticate the user without&amp;nbsp;ever showing them my app secret, or the access token I received from Dropbox.&lt;/P&gt;
&lt;P&gt;However, I also want to use the Dropbox API from JavaScript on my site, so that I can have the browser hit the Dropbox API directly without going through my backend as a proxy. This is especially important for uploading files to Dropbox.&lt;/P&gt;
&lt;P&gt;I could include my&amp;nbsp;OAuth access token in the HTML page I send to the user, which would allow the JavaScript to pick it up and stick it in the `Authorization` header to make API requests. However, that strikes me as insecure -- the user would be able to see my access token, which I thought was supposed to be secret. Is this the correct way of doing this, or is there a better way I can allow the user's browser to make API requests to Dropbox?&lt;/P&gt;</description>
    <pubDate>Wed, 29 May 2019 09:32:49 GMT</pubDate>
    <dc:creator>David B.37</dc:creator>
    <dc:date>2019-05-29T09:32:49Z</dc:date>
    <item>
      <title>Safely expose credentials to JavaScript client?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Safely-expose-credentials-to-JavaScript-client/m-p/169343#M6248</link>
      <description>&lt;P&gt;I'm building an application with Dropbox that allows the user to log in with Dropbox using OAuth 2. I've made an app on Dropbox, put the app key and app secret into my application code, and I can successfully authenticate the user without&amp;nbsp;ever showing them my app secret, or the access token I received from Dropbox.&lt;/P&gt;
&lt;P&gt;However, I also want to use the Dropbox API from JavaScript on my site, so that I can have the browser hit the Dropbox API directly without going through my backend as a proxy. This is especially important for uploading files to Dropbox.&lt;/P&gt;
&lt;P&gt;I could include my&amp;nbsp;OAuth access token in the HTML page I send to the user, which would allow the JavaScript to pick it up and stick it in the `Authorization` header to make API requests. However, that strikes me as insecure -- the user would be able to see my access token, which I thought was supposed to be secret. Is this the correct way of doing this, or is there a better way I can allow the user's browser to make API requests to Dropbox?&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:32:49 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Safely-expose-credentials-to-JavaScript-client/m-p/169343#M6248</guid>
      <dc:creator>David B.37</dc:creator>
      <dc:date>2019-05-29T09:32:49Z</dc:date>
    </item>
    <item>
      <title>Re: Safely expose credentials to JavaScript client?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Safely-expose-credentials-to-JavaScript-client/m-p/169344#M6249</link>
      <description>&lt;P&gt;*moves to API forum*&lt;/P&gt;</description>
      <pubDate>Sun, 12 Jun 2016 04:29:00 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Safely-expose-credentials-to-JavaScript-client/m-p/169344#M6249</guid>
      <dc:creator>Mark</dc:creator>
      <dc:date>2016-06-12T04:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: Safely expose credentials to JavaScript client?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Safely-expose-credentials-to-JavaScript-client/m-p/169345#M6250</link>
      <description>&lt;P&gt;Hi David, it sounds like you have a good handle on this already. In order to make an API call, the client (in this case, the browser) needs the access token. Fundamentally though, client-side apps, (such as in a browser) can't keep secrets.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That means that the access token would be exposed to the users, compromising your account. Unfortunately, there isn't a good way to do this without proxying the requests through your server. (And just to be clear, this is only a problem in the case where you only want to connect to your own account for all users. In the normal case, where users only connect to their own accounts, this is fine since they'd only have their own access tokens anyway.)&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2016 00:52:11 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Safely-expose-credentials-to-JavaScript-client/m-p/169345#M6250</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2016-06-14T00:52:11Z</dc:date>
    </item>
    <item>
      <title>Re: Safely expose credentials to JavaScript client?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Safely-expose-credentials-to-JavaScript-client/m-p/169346#M6251</link>
      <description>&lt;P&gt;Great! I wasn't sure if I would need to do some sort of special Javascript authentication, but I guess not. Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2016 02:42:33 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Safely-expose-credentials-to-JavaScript-client/m-p/169346#M6251</guid>
      <dc:creator>David B.37</dc:creator>
      <dc:date>2016-06-14T02:42:33Z</dc:date>
    </item>
  </channel>
</rss>

