cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Back again with another edition of 'How we use Dropbox', so find out how Emma uses to-do lists to get it all done 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: 

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

Re: Dropbox API V2 Sign out

Steve M.
Dropboxer

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.

Re: Dropbox API V2 Sign out

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.

Re: Dropbox API V2 Sign out

Steve M.
Dropboxer

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.

Re: Dropbox API V2 Sign out

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.

Re: Dropbox API V2 Sign out

Steve M.
Dropboxer

What does your "Login" button do?

Just do that again.

Re: Dropbox API V2 Sign out

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.

Re: Dropbox API V2 Sign out

L. Ladibug
New member | Level 1

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

Re: Dropbox API V2 Sign out

Steve M.
Dropboxer

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.

Re: Dropbox API V2 Sign out

L. Ladibug
New member | Level 1

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

 

Poll
We love to learn from the educators who use Dropbox. Whether you teach kids, teens, adults or a combination of all three, we want to know what apps and integrations you use with Dropbox to help with teaching. Which of the ones below is your favorite, or most used tool?
Who's talking

Top contributors to this post

  • User avatar
    L. Ladibug New member | Level 1
  • User avatar
    Steve M. Dropboxer
What do Dropbox user levels mean?
Need more support?