Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
528 views
in Technique[技术] by (71.8m points)

openid - google account logout and redirect

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 ??

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

Question&Answers:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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";
}

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

I hope this can help.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...