cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to know what we learned at IBC? Check out our learnings on media, remote working and more right here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

token is gone after refresh

token is gone after refresh

Acey1
New member | Level 2

so i'm working on a website that uploads images to a folder
and for the first day it works just fine nothing is wrong
then the day after when i tried it again
it says the access token is invalid
so i regenerated it
i tried again and it still says invalid
so i regenerated it again
and i refreshed the page
and now the access token is gone and asks me to generate a new one
i generated it and refreshed 3 more times
and every time its gone
idk why

2 Replies 2

Здравко
Legendary | Level 20

@Acey1 wrote:
...
and now the access token is gone and asks me to generate a new one
i generated it and refreshed 3 more times
...

Hi @Acey1,

Your explanation is not very clear. What you mean with generated it? Also, what exactly you have refreshed? Refresh is automatic process!

Regular access token is valid for 4 hours only. After that it could be "refreshed" with refresh token acquired on initial authentication. Have you received refresh token? Did you use it on your refresh or you mean something else?!

Probably you got confused by "advertisement" of already dropped long time access token feature. Despite issued earlier long time access tokens can still be used, new issued tokens are no longer "long time". Just take this in mind and use the refresh token instead.

Hope this gives direction.

Greg-DB
Dropbox Staff

@Acey1 It sounds like you're using the "Generate" button on the app's page on the App Console to create a new access token. Note that this now only creates "short-lived access tokens", which do expire after a short period of time. Also, note that if you leave or refresh that page, the previous access token will no longer be shown there. It is only shown when you Generate it so you can copy it to wherever you need it.

 

For reference, Dropbox is in the process of switching to only issuing short-lived access tokens (and optional refresh tokens) instead of long-lived access tokens. You can find more information on this migration here.

 

Apps can still get long-term access by requesting "offline" access though, in which case the app receives a "refresh token" that can be used to retrieve new short-lived access tokens as needed, without further manual user intervention. You can find more information in the OAuth Guide and authorization documentation.

 

For reference, while the creation of new long-lived access tokens is now deprecated, we don't currently have a plan to disable existing long-lived access tokens. (If that changes, we will of course announce that ahead of time.) That being the case, you can continue using existing long-lived access token(s) without interruption, if you have any. Also, note though that after the change you won't be able to create new long-lived access tokens.

 

While the change began on September 30th 2021, we're releasing it gradually, so you may not have seen your app(s) affected until now. Once it applies to your app, it would apply regardless of the "Access token expiration" setting for your app, and that setting may no longer be available for your app.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Здравко Legendary | Level 20
What do Dropbox user levels mean?