cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Share your feedback on the Document Scanning Experience in the Dropbox App 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: 

Invalid access token when generating new token after revoke() API V2

Invalid access token when generating new token after revoke() API V2

mattcmf
New member | Level 2
Go to solution

I am getting a "invalid_access_token" when trying to generate a new token, after the first token has been revoked, e.g. log out, then log back in again. I am using API V2 on Android.

 

First

DropboxClientFactory.init(XYZ.getApiToken());
DbxClientV2 dbxClientV2 = DropboxClientFactory.getClient();
dbxClientV2.auth().tokenRevoke();

 

Then running through the oAuth flow again and obtaining the new (verified as different token) and finally calling:

DropboxClientFactory.init(Auth.getOAuth2Token());
DbxClientV2 dbxClientV2 = DropboxClientFactory.getClient();
dbxClientV2.users().getCurrentAccount()

I hit the invalid access token.  

 

The first pass works fine, but after I revoke and regenerate I am stuck in a loop as the oAuth keeps failing.

1 Accepted Solution

Accepted Solutions

mattcmf
New member | Level 2
Go to solution

Resolved this myself using the solution from here:

https://github.com/dropbox/dropbox-sdk-java/issues/92

 

(Specifically steps 3 and 4).

The documentation is very unclear on the flow for re-authentication for API 2, in addition the sample project does not contain an example of how to use revoke token. May I suggest that the documentation is updated to reflect the hotfix mentioned in the github post?

View solution in original post

2 Replies 2

mattcmf
New member | Level 2
Go to solution

Resolved this myself using the solution from here:

https://github.com/dropbox/dropbox-sdk-java/issues/92

 

(Specifically steps 3 and 4).

The documentation is very unclear on the flow for re-authentication for API 2, in addition the sample project does not contain an example of how to use revoke token. May I suggest that the documentation is updated to reflect the hotfix mentioned in the github post?

Greg-DB
Dropbox Staff
Go to solution
Thanks! I'll ask the team to update the documentation.
Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    mattcmf New member | Level 2
What do Dropbox user levels mean?