<?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: Javascript SDK to authorize user and get access token in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Javascript-SDK-to-authorize-user-and-get-access-token/m-p/376858#M21137</link>
    <description>&lt;P&gt;If you're using the official&amp;nbsp;Dropbox API v2 JavaScript to integrate with&amp;nbsp;Dropbox in a JavaScript app, you should use the supplied 'getAuthenticationUrl' method to build your authorization URL, which will contain whatever redirect URI value you supply. There's &lt;A href="https://github.com/dropbox/dropbox-sdk-js/blob/master/examples/javascript/auth/index.html" target="_self"&gt;a working auth example included with the SDK here&lt;/A&gt;. (&lt;A href="https://github.com/dropbox/dropbox-sdk-js/tree/master/examples/javascript" target="_self"&gt;Instructions for running the examples can be found here&lt;/A&gt;.)&lt;/P&gt;
&lt;P&gt;On &lt;A href="https://github.com/dropbox/dropbox-sdk-js/blob/master/examples/javascript/auth/index.html#L91" target="_self"&gt;this line&lt;/A&gt;, you call the&amp;nbsp;getAuthenticationUrl method, supplying what you want your redirect URI to be. It gives back the full /oauth2/authorize URL, which is where you should send the user. In the example it does so by giving them a link set to that URL so they can click on it. I expect you can alternatively just pass it to window.open though. That would look like:&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;window.open(dbx&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN class="pl-en"&gt;getAuthenticationUrl&lt;/SPAN&gt;&lt;SPAN&gt;(redirectUri&lt;/SPAN&gt;&lt;SPAN&gt;));&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;Once the user authorizes the app,&amp;nbsp;Dropbox will redirect them to the specified redirect URI. In the example, &lt;A href="https://github.com/dropbox/dropbox-sdk-js/blob/master/examples/javascript/auth/index.html#L78" target="_self"&gt;the access token is retrieved from the URL fragment here&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Wed, 06 Nov 2019 22:04:02 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2019-11-06T22:04:02Z</dc:date>
    <item>
      <title>Javascript SDK to authorize user and get access token</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Javascript-SDK-to-authorize-user-and-get-access-token/m-p/376821#M21133</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to get access token after Autharization.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So on button click I redirect user to&lt;/P&gt;&lt;PRE&gt; https://www.dropbox.com/oauth2/authorize?client_id=&amp;lt;APP_KEY&amp;gt;&amp;amp;response_type=code &lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;So user goes through the steps and authorize the app but it goes to a page like this II&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 999px;"&gt;&lt;img src="https://www.dropboxforum.com/t5/image/serverpage/image-id/12080iF62C23C3308AD227/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I use Window.open with redirect url.&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;window.open(url,redirectURL );&lt;/PRE&gt;&lt;P&gt;I have a feeling I am not constructing redirect url properly. Can you please provide me with an example of window.open with proper url?&lt;/P&gt;&lt;P&gt;What am I doing wrong here?&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 21:06:59 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Javascript-SDK-to-authorize-user-and-get-access-token/m-p/376821#M21133</guid>
      <dc:creator>namiqismayil</dc:creator>
      <dc:date>2019-11-06T21:06:59Z</dc:date>
    </item>
    <item>
      <title>Re: Javascript SDK to authorize user and get access token</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Javascript-SDK-to-authorize-user-and-get-access-token/m-p/376858#M21137</link>
      <description>&lt;P&gt;If you're using the official&amp;nbsp;Dropbox API v2 JavaScript to integrate with&amp;nbsp;Dropbox in a JavaScript app, you should use the supplied 'getAuthenticationUrl' method to build your authorization URL, which will contain whatever redirect URI value you supply. There's &lt;A href="https://github.com/dropbox/dropbox-sdk-js/blob/master/examples/javascript/auth/index.html" target="_self"&gt;a working auth example included with the SDK here&lt;/A&gt;. (&lt;A href="https://github.com/dropbox/dropbox-sdk-js/tree/master/examples/javascript" target="_self"&gt;Instructions for running the examples can be found here&lt;/A&gt;.)&lt;/P&gt;
&lt;P&gt;On &lt;A href="https://github.com/dropbox/dropbox-sdk-js/blob/master/examples/javascript/auth/index.html#L91" target="_self"&gt;this line&lt;/A&gt;, you call the&amp;nbsp;getAuthenticationUrl method, supplying what you want your redirect URI to be. It gives back the full /oauth2/authorize URL, which is where you should send the user. In the example it does so by giving them a link set to that URL so they can click on it. I expect you can alternatively just pass it to window.open though. That would look like:&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;window.open(dbx&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN class="pl-en"&gt;getAuthenticationUrl&lt;/SPAN&gt;&lt;SPAN&gt;(redirectUri&lt;/SPAN&gt;&lt;SPAN&gt;));&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;Once the user authorizes the app,&amp;nbsp;Dropbox will redirect them to the specified redirect URI. In the example, &lt;A href="https://github.com/dropbox/dropbox-sdk-js/blob/master/examples/javascript/auth/index.html#L78" target="_self"&gt;the access token is retrieved from the URL fragment here&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 22:04:02 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Javascript-SDK-to-authorize-user-and-get-access-token/m-p/376858#M21137</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2019-11-06T22:04:02Z</dc:date>
    </item>
  </channel>
</rss>

