我的应用程序与Facebook,Google和Microsoft(使用OAuth)集成.
要从facebook注销,我使用以下网址:
https://www.facebook.com/logout.PHP?next=[YourAppURL]&access_token=[ValidAccessToken]
谷歌和微软有类似的东西吗?
对于谷歌,我试过:
https://accounts.google.com/logout?continue=http://localhost:51820
但它不起作用……它返回:您请求的页面无效.
如何获取该URL注销?
解决方法
我终于得到了正确的链接:
> Facebook:
https://www.facebook.com/logout.PHP?next=[YourAppURL]\u0026amp;access_token=[ValidAccessToken]
资料来源:A Working Facebook OAuth Logout URL
>谷歌:
https://www.google.com/accounts/logout?continue=https://appengine.google.com/_ah/logout?continue=[http://www.mysite.com]
资料来源:google account logout and redirect
>微软:
https://login.live.com/oauth20_logout.srf?client_id=[CLIENT_ID]\u0026amp;redirect_uri=[REDIRECT_URL]
这些链接可以像JavaScript一样使用:
function logout (){ document.location.href = "https://www.facebook.com/logout.PHP?next=[YourAppURL]&access_token=[ValidAccessToken]"; }
建议实施:Logout from external login service (Gmail,facebook) using oauth