Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging out? #3

Open
poik007 opened this issue Jan 30, 2014 · 5 comments
Open

Logging out? #3

poik007 opened this issue Jan 30, 2014 · 5 comments

Comments

@poik007
Copy link

poik007 commented Jan 30, 2014

Heya, I'm trying to allow the user to "logout" of a session (so he could theoretically pass the iPad to a friend without fear of them seeing their private accounts) but I'm confused by the the layers of sessions, clients, file services, keychains, etc.

So far I can delete the keychain value just fine (so when the program closes and re-opens, you're logged out) but I cant seem to be able to make the logout immediate, I've tried a bunch of things, unsetting sessions, removing all file services and adding them again, to no avail. I'm kinda new to objective-c too so it might not help.

If you have a few minutes to spare and an idea of a way it would be doable, it would be very appreciated.

@GrahamDennis
Copy link
Owner

-[GDFileServiceSession unlink] is supposed to do this, but it may be incomplete. Also, the method should probably be called logOut.

Currently -[GDFileServiceSession unlink] removes the file service session from its file service, but we should also remove the credentials from the GDClientManager (which will also delete them from the keychain).

So, given an GDFileServiceSession called session we should do:

GDClientManager *clientManager = session.fileService.clientManager ;
while ((GDClientCredential *credential = [clientManager credentialForUserID:session.client.userID])) {
    [clientManager removeCredential:credential];
}

That should work, but let me know if it doesn't.

@poik007
Copy link
Author

poik007 commented Feb 10, 2014

After testing this out, it does the same thing all my previous attempts did, it indeeds logs the user out, but you still have access to files and folders. If you close the app and start it again, then the user is logged out and you have to log back in. There must be another spot where some infos are kept, otherwise the user shouldn't be able to access his data without having to re-enter his username/password, no?

@othmaan
Copy link

othmaan commented Jun 25, 2014

The same here. If I select GDrive module for instance I get an alert view. The operation couldn't be completed. GDFileManagerErrorDomain error 101.

Next app restart, it implements the logout.

@mustafaibrahim989
Copy link

Work around solution: just remove current service from self.tableData NSArray

@othmaan
Copy link

othmaan commented Jul 7, 2014

It works . Thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants