Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google App Engine logout of app only, not entire google account

I have created a logout url with the users api: https://developers.google.com/appengine/docs/go/users/overview

But I only want it to disconnect them from my app, not log them out of their other Google services (Gmail etc). Is that possible?

like image 893
Dijkstra Avatar asked Jan 14 '13 16:01

Dijkstra


1 Answers

You can't do this directly with the users API but see this question for alternative options:

Instead of using the UserService API to logout, you can manually remove the AppEngine specific cookies that are set. Check out this blog post that discusses how to so (written in Python, but you should be able to modify it for Java). This should effectively log the user out from your own app but not from other Google services (though I haven't tested this myself).

The more robust approach would be to create your own User class and manage your own session cookies, while wrapping the UserService API. The downside of this approach is the extra work that is required to set it up, compared to the very easy to use UserService API. However, the advantage of maintaining your own Users is that you will be able to use other methods of authentication besides for Google (e.g. now you will be able to use a Facebook login as well, or even a native login if you choose to set that up).

like image 104
Pixel Elephant Avatar answered Nov 15 '22 05:11

Pixel Elephant