Facebook亭注销 [英] Facebook Kiosk Logout

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

问题描述

我们有一个Facebook网站应用程序,可以用作公共活动信息亭.许多人将在同一设备(设置在ipad或类似设备的展位上)上通过我们的网站登录Facebook.

We have a facebook website app for use as a public event kiosk. Many people will be logging into facebook through our site on the same device (set up at a booth, like a ipad or similar).

完成操作后,我们需要将该人从Facebook本身注销;不只是破坏我们网站的图API会话.

We need to log the person out of facebook itself after they are done; not simply destroy the graph api session for our site.

问题出在这里

  1. 用户走到我们的ipad,该ipad已将浏览器加载到我们的网站上.他或她单击收藏夹登录",并被重定向到Facebook进行登录.
  2. 他们登录并授予我们的应用权限,然后Facebook将其重定向回我们的网站.
  3. 使用我们的网站后(发表评论等),然后单击注销".
  4. 下一个用户坐下,单击"facebook登录",然后重定向到Facebook.到达facebook.com时,浏览器仍为前一个用户登录,从而授予该用户访问第一个用户的facebook的权限(只是一个小问题=)
  1. User walks up to our ipad, which has a browser loaded to our website. He or she clicks "facbook login", and is redirected to facebook to log in.
  2. They log in, grant our app permission, and facebook redirects them back to our site.
  3. After they use our site (post comment, etc...) they click log out on our site.
  4. Next user sits down, clicks "facebook login", and is redirected to facebook. Upon reaching facebook.com, the browser is still logged in for the previous user, granting this user access to the first user's facebook (just a small problem =)

我的希望是,我可以将用户发送到Facebook,到一个页面只有一个注销按钮,然后让Facebook将浏览器重定向回我的站点,为下一个用户准备.这就是登录的工作方式,我需要等价的注销.

My hope is that I can send the user to facebook, to a page with nothing but a logout button, and have facebook redirect the browser back to my site, ready for the next user. This is how the login works, and I need a logout equivalent.

非常感谢您的回答.我们花了大约三天的时间来解决这个问题;如果我们发布任何人都可以插入的通用代码,希望您能原谅我们.将其放置在HTML页面上,然后访问该页面,使用户退出Facebook 您的网站.

Thank you very much for the answer. We spent like 3 days trying to figure this out; I hope you will forgive us if we post generic code that anyone can plug in. Placing this on an HTML page, then visiting that page, logs the user out of Facebook and your site.

<div id="fb-root"></div>
<script>
  window.fbAsyncInit = function() {
    FB.init({
      appId      : 'your APP ID', // App ID
      channelUrl : '//WWW.YOURSITE.COM/channel.php or channel.html or whatever yours is', // Channel File
      status     : true, // check login status
      cookie     : true, // enable cookies to allow the server to access the session
      xfbml      : true  // parse XFBML
    });
    // Additional initialization code here
    FB.getLoginStatus(function(response) {
    if (response.status === 'connected') {
      var uid = response.authResponse.userID;
      var accessToken = response.authResponse.accessToken;
      FB.logout();
      alert('Thanks!  You have been logged out of facebook.');
    }
   });            
  };
  (function(d){
     var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
     if (d.getElementById(id)) {return;}
     js = d.createElement('script'); js.id = id; js.async = true;
     js.src = "//connect.facebook.net/en_US/all.js";
     ref.parentNode.insertBefore(js, ref);
   }(document));
</script>

推荐答案

如果使用Facebook Javascript SDK,则可以调用

If you use the Facebook Javascript SDK, you can call FB.logout when they click your logout link as the documentation states:

FB.logout将使用户退出您的网站和Facebook.

FB.logout will log the user out of both your site and Facebook.

这篇关于Facebook亭注销的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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