无法登录我的Facebook OAuth会话,而不记录用户从Facebook [英] Can't Logout of my Facebook OAuth Session without logging User Out of Facebook

查看:113
本文介绍了无法登录我的Facebook OAuth会话,而不记录用户从Facebook的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据SDK,我正在使用带有重定向的logout.php:

Per the SDK, I am using the logout.php with redirect:

https://www.facebook.com/logout.php?confirm=1&next={SOME URL}&access_token={ACCESSTOKEN}

它正在记录我,但它也将用户记录在Facebook之外。是否有办法退出我的OAuth会话而不注销Facebook?

It is logging me out fine, but it's also logging the user out of facebook. Isn't there a way of logging out of my OAuth session without logging out of facebook?

推荐答案

是的,我碰到了同样的问题我自己不要做logout.php或JS SDK的FB.logout()。而是使用HTTP Delete命令将Graph API调用到 me / permissions 。这将会杀死访问令牌,从用户的应用程序列表中删除该应用程序,并维护其浏览器的Cookie。您可以将其称为服务器端或客户端。这是客户端的JavaScript SDK方式:

Yes, I ran into this same issue myself. Dont do logout.php or JS SDK's FB.logout(). Rather call the Graph API with an HTTP Delete command to me/permissions. That will kill the access token, remove the app from the user's app listing and maintain their browser's cookie for facebook. You can call it either server side or client side. Here's the client side Javascript SDK way:

FB.api("me/permissions","delete", function(response){/*do something if you want*/})

这篇关于无法登录我的Facebook OAuth会话,而不记录用户从Facebook的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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