google帐户注销并重定向

google帐户注销并重定向

本文介绍了google帐户注销并重定向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用openid登录用户.(仅适用于Google帐户).现在,我的页面上有一个注销链接,单击该链接后,我希望用户从google帐户中注销,并将页面重定向到我的主页.可以做到吗?

I am using openid to log the user in.(google account only).Now I have a sign out link in my page, which on clicking, I want the user to be logged out of google accounts and the page to be redirected to my home page.can this be done ??

编辑-
更改接受的答案,因为现在Google允许[继续]重定向到您想要的任何域.

Edit-
Changing the accepted answer because now Google allows redirecting [continuing] to any domain you want.

推荐答案

当用户单击注销链接时,我已经解决了调用此函数的问题:

I have solved this issue calling this function when the user click on the logout link:

var logout = function(){
document.location.href = "https://www.google.com/accounts/Logout?continue=https://appengine.google.com/_ah/logout?continue=http://www.example.com";
}

当用户单击链接时,浏览器将用户重定向到注销页面,并且仅在注销完成后,用户才被重定向到站点" http://www.example.com ".

When the user click on the link, the browser redirect the user to the logout page and only when the logout is complete, the user is redirected to the site "http://www.example.com".

我希望这会有所帮助.

这篇关于google帐户注销并重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-16 07:31