<?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 Generated Access Token not working for authentication (Python) in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Generated-Access-Token-not-working-for-authentication-Python/m-p/128009#M3724</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I generated an access token on my app page, but it does not seem to be working. I am using it in place of the token that is normally generated when give it access from the webpage. Here is my current code:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;import dropbox
app_key = 'xxxxxxxxxxxxx'
app_secret = 'xxxxxxxxxxxxx'
flow = dropbox.client.DropboxOAuth2FlowNoRedirect(app_key, app_secret)
authorize_url = flow.start()
code = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
access_token, user_id = flow.finish(code)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am definitely putting in the right access token, secret, and key.&lt;/P&gt;</description>
    <pubDate>Wed, 29 May 2019 09:42:17 GMT</pubDate>
    <dc:creator>Nicholas H.2</dc:creator>
    <dc:date>2019-05-29T09:42:17Z</dc:date>
    <item>
      <title>Generated Access Token not working for authentication (Python)</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Generated-Access-Token-not-working-for-authentication-Python/m-p/128009#M3724</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I generated an access token on my app page, but it does not seem to be working. I am using it in place of the token that is normally generated when give it access from the webpage. Here is my current code:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;import dropbox
app_key = 'xxxxxxxxxxxxx'
app_secret = 'xxxxxxxxxxxxx'
flow = dropbox.client.DropboxOAuth2FlowNoRedirect(app_key, app_secret)
authorize_url = flow.start()
code = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
access_token, user_id = flow.finish(code)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am definitely putting in the right access token, secret, and key.&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:42:17 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Generated-Access-Token-not-working-for-authentication-Python/m-p/128009#M3724</guid>
      <dc:creator>Nicholas H.2</dc:creator>
      <dc:date>2019-05-29T09:42:17Z</dc:date>
    </item>
    <item>
      <title>Re: Generated Access Token not working for authentication (Python)</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Generated-Access-Token-not-working-for-authentication-Python/m-p/128010#M3725</link>
      <description>&lt;P&gt;I should add, it does give me this error:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Traceback (most recent call last):
  File "pictures.py", line 15, in &amp;lt;module&amp;gt;
    access_token, user_id = flow.finish(code)
  File "C:\Python27\lib\site-packages\dropbox-2.2.0-py2.7.egg\dropbox\client.py"
, line 1398, in finish
    return self._finish(code, None)
  File "C:\Python27\lib\site-packages\dropbox-2.2.0-py2.7.egg\dropbox\client.py"
, line 1265, in _finish
    response = self.rest_client.POST(url, params=params)
  File "C:\Python27\lib\site-packages\dropbox-2.2.0-py2.7.egg\dropbox\rest.py",
line 316, in POST
    return cls.IMPL.POST(*n, **kw)
  File "C:\Python27\lib\site-packages\dropbox-2.2.0-py2.7.egg\dropbox\rest.py",
line 254, in POST
    post_params=params, headers=headers, raw_response=raw_response)
  File "C:\Python27\lib\site-packages\dropbox-2.2.0-py2.7.egg\dropbox\rest.py",
line 227, in request
    raise ErrorResponse(r, r.read())
dropbox.rest.ErrorResponse: [400] u'invalid_grant'
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 04 Jun 2015 06:46:16 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Generated-Access-Token-not-working-for-authentication-Python/m-p/128010#M3725</guid>
      <dc:creator>Nicholas H.2</dc:creator>
      <dc:date>2015-06-04T06:46:16Z</dc:date>
    </item>
    <item>
      <title>Re: Generated Access Token not working for authentication (Python)</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Generated-Access-Token-not-working-for-authentication-Python/m-p/128011#M3726</link>
      <description>&lt;P&gt;Try just this instead:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;from dropbox.client import DropboxClient
access_token = 'xxxxxxx' # &amp;lt;-- your generated access token
client = DropboxClient(access_token)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It looks like what you're trying to do is use your access token as the "authorization code" for the OAuth flow, but that's not right. The result of the OAuth flow is an access token, and you already have one of those, so you're done!&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jun 2015 06:54:28 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Generated-Access-Token-not-working-for-authentication-Python/m-p/128011#M3726</guid>
      <dc:creator>Steve M.</dc:creator>
      <dc:date>2015-06-04T06:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: Generated Access Token not working for authentication (Python)</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Generated-Access-Token-not-working-for-authentication-Python/m-p/128012#M3727</link>
      <description>&lt;P&gt;Hi Steve M ,&lt;/P&gt;
&lt;P&gt;I'm using&amp;nbsp;&lt;A href="https://www.dropbox.com/developers/core/docs#oa2-authorize" rel="nofollow noreferrer"&gt;https://www.dropbox.com/developers/core/docs#oa2-authorize&lt;/A&gt; to authenticate user and&amp;nbsp;&lt;/P&gt;
&lt;P&gt;then I'm getting code in return at url.&lt;/P&gt;
&lt;PRE class="literal-block"&gt;&lt;CODE&gt;Redirect url is like this --&amp;gt; [REDIRECT_URI]?code=ABCDEFG&amp;amp;state=[STATE]&lt;BR /&gt;&lt;BR /&gt;After that I'm using below codes to get access token from the above &lt;BR /&gt;code.&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE&gt;flow.start()&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE&gt;access_token, user_id = flow.finish(code)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE&gt;It gives me invalid_grant error.? Can you help please.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Aug 2015 16:05:44 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Generated-Access-Token-not-working-for-authentication-Python/m-p/128012#M3727</guid>
      <dc:creator>Jay M.1</dc:creator>
      <dc:date>2015-08-21T16:05:44Z</dc:date>
    </item>
    <item>
      <title>Re: Generated Access Token not working for authentication (Python)</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Generated-Access-Token-not-working-for-authentication-Python/m-p/128013#M3728</link>
      <description>&lt;P&gt;Hi Jay, if you're using using the redirect flow, i.e., with DropboxOAuth2FlowNoRedirect, you need to pass all of the args to &lt;A href="https://www.dropbox.com/developers/core/docs/python#DropboxOAuth2Flow.finish" target="_blank" rel="nofollow noreferrer"&gt;.finish()&lt;/A&gt;, so that the state can be checked as well, not just code.&lt;/P&gt;
&lt;P&gt;Also, you only need to call .start() when sending the user off to the auth flow initially, and not again when they come back via the redirect.&lt;/P&gt;</description>
      <pubDate>Sat, 22 Aug 2015 00:53:52 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Generated-Access-Token-not-working-for-authentication-Python/m-p/128013#M3728</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2015-08-22T00:53:52Z</dc:date>
    </item>
  </channel>
</rss>

