Forum Discussion

autozoom3125's avatar
autozoom3125
Explorer | Level 4
6 years ago

Authentication tokens keep expiring

I've got some python code that uploads files to my dropbox folder, but I must be doing something wrong, because my authentication tokens keep expiring, despite multiple claims that these tokens should be long-lived.

I'm not using the test-api, but rather I did the following:

dbx_oauth = dropbox.oauth.DropboxOAuth2FlowNoRedirect(DROPBOX_APP_KEY, DROPBOX_APP_SECRET)
url_for_oauth = dbx_oauth.start()
print(url_for_oauth)
# Follow the link, get a short code, copy it, and paste into the finish method:
oauth_result = dbx_oauth.finish('SomeCodeOrOtherBlahBlahBlah')
print(oauth_result.access_token)
# I now have a TOKEN that I use for the rest of the day...

But as mentioned, this token expires and it's driving me nuts because it's messing up my work-flow.

What am I doing wrong?

Also, being the "owner" of my dropbox account, couldn't I bypass this whole token thing by using my app-key and and app-secret directly somehow??

 

Thanks!

1 Reply

About Discuss Dropbox Developer & API

Node avatar for Discuss Dropbox Developer & API
Make connections with other developers

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!