Our Community is in read-only mode until April 8th, learn more here. You can still search existing threads or get help via Dropbox Support, the Dropbox Help Center, or Learn.
Forum Discussion
luigiafassina
3 years agoExplorer | Level 4
Why I have refresh token null? What should I do now?
Hi, I have an app that allows the users to connect their Dropbox accounts and see the content directly in the app. When the user enters his credentials and grants permission in the Dbx form, my app r...
- 3 years ago
luigiafassina Can you clarify what you mean when you say "they disappeared for all the users in all my envs"? What exactly disappeared and how? The refresh tokens are strings that you should store and re-use. Apps and users can revoke refresh tokens on demand, though you should still have the refresh token strings themselves; they would just no longer work.
If the app is disconnected/the refresh token revoked, you would need to process the authorization flow again for the user. I see you are requesting offline access in this code snippet. Can you double check this is the exact code you're running in that case?
luigiafassina
3 years agoExplorer | Level 4
Yes, I'm sure. I'm using dropbox sdk 4.0.1.
public String authorize(DbxSessionStore sessionStore, String redirectUri) {
// V2 api /oauth2/authorize
// TokenAccessType.OFFLINE means refresh_token + access_token.
// ONLINE means access_token only.
DbxWebAuth.Request authRequest = DbxWebAuth.newRequestBuilder()
.withRedirectUri(redirectUri, sessionStore)
.withTokenAccessType(TokenAccessType.OFFLINE)
.build();
DbxWebAuth webAuth = new DbxWebAuth(reqConfig, appInfo);
return webAuth.authorize(authRequest);
}I had the information and all worked, then they disappeared for all the users in all my envs (staging/production). I see in the docs that the refresh token could be revoked by dropbox.. Could this be the case? And what should I do now? I 've disconnected my account, I've cleaned my db, and retried to connect..but still no expire date and no refresh token returned.
Greg-DB
Dropbox Community Moderator
3 years agoluigiafassina Can you clarify what you mean when you say "they disappeared for all the users in all my envs"? What exactly disappeared and how? The refresh tokens are strings that you should store and re-use. Apps and users can revoke refresh tokens on demand, though you should still have the refresh token strings themselves; they would just no longer work.
If the app is disconnected/the refresh token revoked, you would need to process the authorization flow again for the user. I see you are requesting offline access in this code snippet. Can you double check this is the exact code you're running in that case?
About Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.
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!