How to unlink or log out of dropbox account on iOS
Asked Answered
M

2

5

I am using Dropbox in my own app. Once I login, the tableview is displayed and every time I load that view, I go straight to the table view. But, my concern is, suppose different people are using this application, they might want to login with their own accounts so I want to have an option to logout. How do I do that?

Mcgowen answered 9/5, 2011 at 10:14 Comment(1)
Did you ever find how to logout from the dropbox session ? I am trying to achieve similar functionality .. I am also not able to find a proper way.Saltpeter
M
2

You should drop the tokens you got from the Oauth process , and start the login process over.

https://www.dropbox.com/developers/docs#authentication-for-mobile-devices

Update April '14 : This answer is a bit outdated, as APIs tend to change over time. Other suggestions were made here as well.

Manes answered 24/5, 2011 at 7:54 Comment(3)
I understand that. There is also a method called unlink in DBSession. That should work since it is discarding the saved credentials. In my application, I have provided an option for unlink. If user presses that before trying to upload, then unlink works but if user uploads first and then comes back and unlinks, then unlink does not work. Please advise.Mcgowen
The Oauth process gives you a "lifetime" token (which is actually 10 years.. more than the average lifespan of an ios device..). You should keep track of your login/logout session within your application , because using the token will be allowed , no matter which "logout" button you've created. In other words : keep a private property of login status ,and act accordingly.Manes
But isn't that what I'm doing by providing the setting? If unlink option is selected, I will then call unlink on the session. If what you're saying is different, please elaborate.Mcgowen
T
6
    [[DBSession sharedSession] unlinkAll];

Works for me.

Thirlage answered 24/6, 2013 at 16:13 Comment(0)
M
2

You should drop the tokens you got from the Oauth process , and start the login process over.

https://www.dropbox.com/developers/docs#authentication-for-mobile-devices

Update April '14 : This answer is a bit outdated, as APIs tend to change over time. Other suggestions were made here as well.

Manes answered 24/5, 2011 at 7:54 Comment(3)
I understand that. There is also a method called unlink in DBSession. That should work since it is discarding the saved credentials. In my application, I have provided an option for unlink. If user presses that before trying to upload, then unlink works but if user uploads first and then comes back and unlinks, then unlink does not work. Please advise.Mcgowen
The Oauth process gives you a "lifetime" token (which is actually 10 years.. more than the average lifespan of an ios device..). You should keep track of your login/logout session within your application , because using the token will be allowed , no matter which "logout" button you've created. In other words : keep a private property of login status ,and act accordingly.Manes
But isn't that what I'm doing by providing the setting? If unlink option is selected, I will then call unlink on the session. If what you're saying is different, please elaborate.Mcgowen

© 2022 - 2024 — McMap. All rights reserved.