Your workflow is unique 👨💻 - tell us how you use Dropbox here.
Forum Discussion
Mixware
8 years agoExplorer | Level 3
How to relink a user (revoke) using the javascript api.
Can anyone show me an example how to use the javascript api to revoke and then let the user re-link to Dropbox?
anthonyhaffey
8 years agoExplorer | Level 4
Greg-DB Thanks for your response. I've tried throwing away the old token, but I've found that my method for asking them to reauthenticate automatically logs them onto the same dropbox account:
dbx.authTokenRevoke();
var dbx = new Dropbox({ clientId: CLIENT_ID });
var authUrl = dbx.getAuthenticationUrl('https://www.open-collector.org/alpha/Admin/Tools/Simulator_SQL/');
document.getElementById('authlink').href = authUrl;
$("#authlink")[0].click();
Is there something I need to change or add to this code to prevent them automatically being authenticated onto the same dropbox account as they were before I revoked the authorisation token?
Greg-DB
Dropbox Community Moderator
8 years agoDepending on your use case, you may want to add the `force_reapprove` or `force_reauthentication` parameters. Please refer to my earlier posts on this thread for more information about those.
Since those aren't implemented in the JavaScript SDK, you'd need to parse and modify the `authUrl` value in this code to add one of those parameters.
Since those aren't implemented in the JavaScript SDK, you'd need to parse and modify the `authUrl` value in this code to add one of those parameters.
- anthonyhaffey8 years agoExplorer | Level 4
Greg-DB Thanks! All I had to do was add "&force_reauthentication=true" to the end of the authUrl generated by the dbx.getAuthenticationUrl function.
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!