从Google帐户退出后如何重定向到登录页面 [英] how to redirect to the login page after logout from google account

查看:390
本文介绍了从Google帐户退出后如何重定向到登录页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我在c#中有asp.net网站。

这里我使用GoogleAccount登录网站。



我成功登录/退出网站,但注销重定向为

Hi guys,

I have asp.net website in c#.
Here i'm using GoogleAccount to login into the website.

I successfully Login/Logout from the website but the logout redirect is as

Logout.aspx
------------
Response.Redirect("https://www.google.com/accounts/Logout");





现在,在重定向到googleLogout页面后,我想将其重定向到登录页面。



任何人都可以请帮助我。





谢谢



Now, after the redirect to googleLogout page, i want to redirect it to Login page.

Can anyone please help me.


Thanks

推荐答案

简单地说,你不能。在将用户从其网站注销后,用户需要将用户重定向到用户的位置。



您可以使用两个选项,第一个是使用Google API并向Google发出请求以将用户注销(但这会让他退出你自己的会话,而不是来自谷歌的网站)。



其他方式是在iframe中运行网站,iframe会加载logout命令页面在iframe中(由于相同来源政策,Google可能会手动取消请求),然后您可以在iframe加载时重定向用户(一旦Google完成用户注销,iframe就会加载)。



只有API方法才有机会。不要个人接受,为什么首先创建这样的功能
Simply, you cannot. It is up to Google to redirect the user where it wants to redirect the user after logging him out from its website.

There are two options that you can use, first one is to use Google APIs and make a request to Google to log the user out (but that would log him out of his own session from your application, not not from Google's website).

Other way is to run the website in an iframe, iframe would load the page of logout command in iframe (chances are Google would manually cancel the request because of Same-origin policy) and then you would be able to redirect the user when the iframe loads (iframe would load once Google has finished logging the user out).

Chances are that are left with only API approach. Don't take it personally, Why create such functionality in the first place?


这篇关于从Google帐户退出后如何重定向到登录页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆