Forum Discussion

BIMcollab's avatar
BIMcollab
Helpful | Level 5
6 years ago

Sign out user from dropbox website with an API call

Hi,

I am wokring with the Dropbox API v2 .NET SDK.

In my code I want to make it so that users can log in with different dropbox credentials. Right now a user can "sign out" and the token is invalidated and deleted. However, if the user has the dropbox website opened in the same browser and is signed in, the sign in step of the OAuth flow is skipped and the user gets a token from the same credentials.

I am looking for a way to sign users out from the dropbox website whenever the token is deleted so that when the user signs in he/she will get the opportunity to fill in new credentials and get a token for another account. Is there a way to achieve this?

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    BIMcollab As Здравко mentioned, you can direct the user to https://www.dropbox.com/logout at any time to log them out of the Dropbox web site. Make sure you do so with the user's understanding though, as forcibly logging them out without their knowledge may be confusing or disruptive to them.

    Or, you can use the 'forceReapprove' or 'forceReauthentication' parameter on the GetAuthorizeUri method to require the user to explicitly re-authorize the app (giving them a chance to switch accounts, if they wish) or log the user out, respectively, during the app authorization flow. (Apologies, the docs there seem to be missing the full description of these parameters. I'll ask the team to fix that up. In the meantime you can find the corresponding documentation in the HTTP docs here.)

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,945 PostsLatest Activity: 3 hours ago
351 Following

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 or Facebook.

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!