我有一个使用facebook Graph API的chrome扩展程序
I have a chrome extension that uses the facebook Graph API
因为它是Chrome扩展程序,所以我正在使用Native App流进行登录.我使用内容脚本从重定向URL中获取令牌.
Because its a Chrome extension I was using the Native App flow to login. I used content-scripts to grab the token out of the redirect URL.
但是,我找不到注销Facebook的方法.我尝试了发布在此处的注销方法: Facebook Oauth注销,但似乎没有工作(我使用我的应用程序ID作为API密钥,并将重定向返回的代码"参数用作会话密钥)
However, I'm unable to find a way to logout of facebook. I tried the logout method posted here: Facebook Oauth Logout , but it doesn't seem to work ( I used my App Id as the API key and the "code" parameter returned by the redirect as the session key )
有人知道这样做的方法吗?
Does anyone know of a way to do this?
推荐答案因此,在跟踪SDK注销过程后,我发现它只是删除了Facebook用户Cookie.具体来说,这段代码将以chrome扩展名退出用户(需要cookie许可):
So, after tracing the SDK logout procedure I found it just deletes the users Cookies for Facebook. Specifically this chunk of code will log the user out in a chrome extension (requires cookie permission):
var facebookDomain = "www.facebook"; chrome.cookies.remove ( {"url": facebookDomain, "name": "act" } ); chrome.cookies.remove ( {"url": facebookDomain, "name": "c_user" } ); chrome.cookies.remove ( {"url": facebookDomain, "name": "checkpoint" } ); chrome.cookies.remove ( {"url": facebookDomain, "name": "lu" } ); chrome.cookies.remove ( {"url": facebookDomain, "name": "s" } ); chrome.cookies.remove ( {"url": facebookDomain, "name": "sct" } ); chrome.cookies.remove ( {"url": facebookDomain, "name": "xs" } );更多推荐
在Chrome扩展程序上注销Facebook
发布评论