<?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: Invalid grant type during authorization with dropbox-oauth2 in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Invalid-grant-type-during-authorization-with-dropbox-oauth2/m-p/417633#M22491</link>
    <description>&lt;P&gt;Dropbox OAuth 2 authorization codes can each only be used once. (You should just use the authorization code once, but you can store and re-use the resulting access token.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The "code has already been used" error message should just indicate that the authorization code you're supplying has already been used. I just gave the flow a try and it seems to be working as expected for me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you double check you're not accidentally re-using the authorization code, or perhaps accidentally issuing the&amp;nbsp;/oauth2/token request more than once?&lt;/P&gt;</description>
    <pubDate>Wed, 06 May 2020 15:55:24 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2020-05-06T15:55:24Z</dc:date>
    <item>
      <title>Invalid grant type during authorization with dropbox-oauth2</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Invalid-grant-type-during-authorization-with-dropbox-oauth2/m-p/417610#M22487</link>
      <description>&lt;P&gt;I am using the passport authenticate with 'dropbox-oauth2' to get my login token and receive my Bearer. This worked fine until about midday yesterday when it started sending me this :&amp;nbsp;error_description: 'code has already been used',&lt;BR /&gt;error: 'invalid_grant'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To get the Dropbox authorization screen, I use this :&lt;/P&gt;
&lt;P&gt;app.get('/dropboxLogin', passport.authenticate('dropbox-oauth2'));&lt;/P&gt;
&lt;P&gt;app.get('/auth/dropbox/callback',&lt;BR /&gt;passport.authenticate('dropbox-oauth2', { failureRedirect: '/', params:{'response_type':'token'} }),&lt;BR /&gt;function(req, res)&lt;BR /&gt;{&lt;BR /&gt;// Successful authentication, redirect home.&lt;BR /&gt;res.render('index', { title:'Dropbox Login', body:res});&lt;BR /&gt;});&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once I've received my token I run :&amp;nbsp;axios({&lt;BR /&gt;method : 'post',&lt;BR /&gt;url : '&lt;A href="https://api.dropboxapi.com/oauth2/token" target="_blank" rel="noopener"&gt;https://api.dropboxapi.com/oauth2/token&lt;/A&gt;',&lt;BR /&gt;params :&lt;BR /&gt;{&lt;BR /&gt;code : request.body.code,&lt;BR /&gt;grant_type : 'authorization_code',&lt;BR /&gt;redirect_uri : 'http://localhost:9000/callback',&lt;BR /&gt;client_id : '##############',&lt;BR /&gt;client_secret : '##############'&lt;BR /&gt;}&lt;BR /&gt;})&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thats when I get the error.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 May 2020 18:54:06 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Invalid-grant-type-during-authorization-with-dropbox-oauth2/m-p/417610#M22487</guid>
      <dc:creator>TheKrominator</dc:creator>
      <dc:date>2020-05-07T18:54:06Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid grant type during authorization with dropbox-oauth2</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Invalid-grant-type-during-authorization-with-dropbox-oauth2/m-p/417633#M22491</link>
      <description>&lt;P&gt;Dropbox OAuth 2 authorization codes can each only be used once. (You should just use the authorization code once, but you can store and re-use the resulting access token.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The "code has already been used" error message should just indicate that the authorization code you're supplying has already been used. I just gave the flow a try and it seems to be working as expected for me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you double check you're not accidentally re-using the authorization code, or perhaps accidentally issuing the&amp;nbsp;/oauth2/token request more than once?&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2020 15:55:24 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Invalid-grant-type-during-authorization-with-dropbox-oauth2/m-p/417633#M22491</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2020-05-06T15:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid grant type during authorization with dropbox-oauth2</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Invalid-grant-type-during-authorization-with-dropbox-oauth2/m-p/417693#M22495</link>
      <description>&lt;P&gt;I've learned that my router file was no longer being called. This caused my '/' command to not run and would return that strange error. Now, that I've reconnected my authorization routes, it is running correctly again.&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2020 18:27:20 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Invalid-grant-type-during-authorization-with-dropbox-oauth2/m-p/417693#M22495</guid>
      <dc:creator>TheKrominator</dc:creator>
      <dc:date>2020-05-06T18:27:20Z</dc:date>
    </item>
  </channel>
</rss>

