Google App Engine仅注销应用程序,而不是整个Google帐户。

huangapple go评论92阅读模式
英文:

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

问题

我已经使用用户API创建了一个注销URL:https://developers.google.com/appengine/docs/go/users/overview

但是我只想让它断开与我的应用的连接,而不是注销他们的其他Google服务(如Gmail等)。这可能吗?

英文:

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?

答案1

得分: 8

您可以使用用户API直接完成此操作,但请参阅此问题以获取替代选项:

> 与使用UserService API注销不同,您可以手动删除设置的AppEngine特定cookie。请查看这篇博文,讨论如何这样做(使用Python编写,但您应该能够修改为Java)。这应该有效地将用户从您的应用程序注销,但不会从其他Google服务注销(尽管我自己没有测试过)。
>
> 更可靠的方法是创建自己的User类并管理自己的会话cookie,同时包装UserService API。这种方法的缺点是需要额外的设置工作,与非常易于使用的UserService API相比。然而,维护自己的用户的优点是您将能够使用除Google之外的其他身份验证方法(例如,现在您还可以使用Facebook登录,或者甚至是本地登录,如果您选择设置)。

英文:

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).

huangapple
  • 本文由 发表于 2013年1月15日 00:40:12
  • 转载请务必保留本文链接:https://go.coder-hub.com/14322674.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定