google-plus-one - 如何使用 Gplus 按钮渲染/删除立即 Google Plus 登录

标签 google-plus-one

根据谷歌文档: 当加载谷歌登录按钮时,它会立即检查用户是否已授权该应用程序。此检查称为“立即模式”,如果成功,Google 服务器将返回访问 token 并将新的授权结果对象传递给回调。如果该按钮无法进行即时授权,则用户必须点击登录按钮才能触发访问流程。

My Google Plus signin button is part of header and on logout the home page is loaded,It again renders google plus button resulting in automatic login. User is never logged out due to this. How is it possible to allow login when when G Plus button is clicked and not when when the G Plus buttom reders itself?

最佳答案

“immediate”参数为我做到了这一点,尽管它与“approvalprompt”具有相同的效果,提示同意。 Facebook 似乎在处理这些选项方面做得更好一些。

gapi.signin.render("splashGPlusReg", { 
'callback': GPSignInCallback, 
'clientid': '<yourclientId>', 
'cookiepolicy': 'single_host_origin',
'immediate': false, 
'requestvisibleactions': 'http://schemas.google.com/AddActivity',
'scope': '<scopes>'                           
});

关于google-plus-one - 如何使用 Gplus 按钮渲染/删除立即 Google Plus 登录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17259585/

相关文章:

javascript - 谷歌加一键不起作用(谷歌加一键错误)

google-plus-one - 有没有一种简单的方法可以判断用户是否有 google 1+ 一个 URL

android - 无法实例化以下类?

google-plus-one - 是否可以通过 API 访问用户的 Google +1 (Plus One) 历史记录?

javascript - Google +1 按钮在多个子页面之间共享,但它不应该

internet-explorer-8 - 在 IE 8 中加载页面后添加 Google +1 按钮

php - 在 PHP 中获取给定 URL 的 google plus 共享

javascript - 在新闻通讯中使用 google plusone 按钮(不是共享按钮)

javascript - Google plus share 设置自定义标题、描述、图像并且不使用 og meta