cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more 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: 

Re: Oauth2 refresh token question - what happens when the refresh token expires?

Oauth2 refresh token question - what happens when the refresh token expires?

FrustratedUser3
Collaborator | Level 8
Go to solution

I've been testing the Dropbox OAuth2 endpoints for a few days and I have read the documentation provided directly by Dropbox. However, it is not clear to me how I'm supposed to handle the acquisition of a new refresh token after the first one has been used. The documentation, diagrams, and code samples do not mention this use case as far as I have seen.

 

In short, I can use one of the available authentication schemes (implicit, PKCE, etc.) to get a token and a refresh token, but then what? I have a Python client running in my environment that needs to connect 24/7, which currently works with long-term tokens, but how do I avoid needing to constantly click 'Allow' when I need to refresh the token? The only way I've been able to reconnect is to send the user back to the browser to get a code. What is supposed to happen when a refresh token expires and how do I deal with it using the implicit and PKCE flows?

 

In most of the other APIs I've used, asking for a new token returns yet another refresh token, which can be done repeatedly without limitation and that's what I need to do in this case as well. I want my users to authorize the app one time and then never need to do so again; that's the end goal.

10 Replies 10

Здравко
Legendary | Level 20
Go to solution

Hi @Zachjaryw,

It's not possible to get refresh token in the same way as was for long lived access token - from your application's profile (not yet at least), if that's what you are asking for. You have to perform authentication and save the refresh token at the end. Can be used different ways; one such simplified could be seen here. 😉

Hope this helps.

Need more support?