在Chrome扩展程序上注销Facebook [英] Facebook Logout on Chrome Extension

查看:84
本文介绍了在Chrome扩展程序上注销Facebook的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用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 = "http://www.facebook.com";
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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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