与返回URL登出链接(的OAuth) [英] Logout link with return URL (OAuth)
问题描述
我的应用程序集成了Facebook,谷歌和微软(使用OAuth)。
要来自Facebook登出我使用以下网址:
<$p$p><$c$c>https://www.facebook.com/logout.php?next=[YourAppURL]&access_token=[ValidAccessToken]有没有类似谷歌和微软?
的东西有关谷歌我尝试:
https://accounts.google.com/Logout?continue=http://localhost:51820
但它没有工作......它返回:您请求的网页无效
我怎样才能得到这个URL注销?
我终于得到了正确链接:
- Facebook的:
<$c$c>https://www.facebook.com/logout.php?next=[YourAppURL]&access_token=[ValidAccessToken]$c$c>
- 谷歌
<$c$c>https://www.google.com/accounts/Logout?continue=https://appengine.google.com/_ah/logout?continue=[http://www.mysite.com]$c$c>
来源:谷歌帐户注销并重定向
- 微软:
<$c$c>https://login.live.com/oauth20_logout.srf?client_id=[CLIENT_ID]&redirect_uri=[REDIRECT_URL]$c$c>
来源:服务器端场景
这些链接可以像在JavaScript中使用:
函数注销(){
document.location.href =https://www.facebook.com/logout.php?next=[YourAppURL]&access_token=[ValidAccessToken];
}
建议来实现这一点:从外部登录使用的服务(Gmail的,脸谱)注销的OAuth
My application is integrated with Facebook, Google and Microsoft (using OAuth).
To logout from facebook I'm using the following URL:
https://www.facebook.com/logout.php?next=[YourAppURL]&access_token=[ValidAccessToken]
Is there something similar for Google and for Microsoft?
For Google I tried:
https://accounts.google.com/Logout?continue=http://localhost:51820
But it didn't work... It returns: The page you requested is invalid.
How can I get that URL logout?
I finally got the right links:
- Facebook:
https://www.facebook.com/logout.php?next=[YourAppURL]&access_token=[ValidAccessToken]
Source: A Working Facebook OAuth Logout URL
- Google:
https://www.google.com/accounts/Logout?continue=https://appengine.google.com/_ah/logout?continue=[http://www.mysite.com]
Source: google account logout and redirect
- Microsoft:
https://login.live.com/oauth20_logout.srf?client_id=[CLIENT_ID]&redirect_uri=[REDIRECT_URL]
Source: Server-side scenarios
Those links can be use like that in JavaScript:
function logout (){
document.location.href = "https://www.facebook.com/logout.php?next=[YourAppURL]&access_token=[ValidAccessToken]";
}
Suggestion to implement this: Logout from external login service (Gmail, facebook) using oauth
这篇关于与返回URL登出链接(的OAuth)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!