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: Dropbox API V2 Sign out

Dropbox API V2 Sign out

L. Ladibug
New member | Level 1

Hi, I am developing an android app. It uses api v2 to upload images, sign in, and sign out. I don't know how to sign out from my app. Can you help me?

11 Replies 11

Steve M.
Dropbox Staff

What do you mean by "sign out?"

If you want to "forget" a user in your app, just delete the stored access token and stop using the auth'd DbxClientV2 object.

L. Ladibug
New member | Level 1

"Sign out" is users can log in another account. Deleting access token is just not to link an existed account.

Steve M.
Dropbox Staff

You can log a user in whenever you want. Just take the new user through the OAuth flow.

Maybe you can be more specific about the problem you're having.

L. Ladibug
New member | Level 1

I use dropbox-sdk-java to develop an Android app. There are three buttons in a window.

One is "Login". Two is "Logout". Three is "Upload". Users can not logout after log a user in.

Can you tell me how to use the sdk to do OAuth flow.

Steve M.
Dropbox Staff

What does your "Login" button do?

Just do that again.

L. Ladibug
New member | Level 1

When users click the button, I will call startOAuth2Authentication api.

If a user account never login, it will ask users to enter E-mail and password.

L. Ladibug
New member | Level 1

I want to ask users to enter E-mail and password every time click login button.

Steve M.
Dropbox Staff

Ah, I think maybe I understand.

  1. A user clicks the "log in" button in your app.
  2. You take the user through the OAuth flow in the browser (since the Dropbox app is not installed).
  3. If the user isn't already logged in to the Dropbox website, they'll need to enter their username and password to log in.
  4. Now a new user on the same device wants to log in to your app. But the previous user is still logged in on the Dropbox website.

So you want to programmatically log the user out of dropbox.com. This is not something you can do via the API, since in general, users don't want apps to be able to log them out of their browser sessions.

That said, you can always send the user to https://www.dropbox.com/logout, which will log them out in the browser, but it won't return the user to your app.

L. Ladibug
New member | Level 1

Thank you a lot. Can I use WebView to login and logout? Do you have sample code?

 

Need more support?