【问题标题】:Facebook Access Token - using the access token in PHP with JavaScript authFacebook 访问令牌 - 使用 PHP 中的访问令牌和 JavaScript 身份验证
【发布时间】:2011-05-10 03:46:17
【问题描述】:

我在我的网站上使用 JavaScript 身份验证,但我想在 PHP 中获取访问令牌,以便我可以存储用户的电子邮件地址。 有没有不使用 PHP 库的快速简便的方法? 谢谢!

PS - 我知道如何在 JS 中获取访问令牌:

FB.login(function(response) {
              if (response.session) {
                if (response.perms) {

                } else {
                  // user is logged in, but did not grant any permissions
                  alert("No Permission..");

                }
              } else {
                // user is not logged in
                alert("Please login to facebook");

              }
            }, {perms:'read_stream,publish_stream,offline_access'});

【问题讨论】:

    标签: facebook facebook-graph-api


    【解决方案1】:

    您不需要 PHP 库:您只需要从 facebook cookie 中提取它。之前在Where to find the Facebook cookie? 上回答过,这表明http://publicvoidlife.blogspot.com/2011/01/quick-and-easy-facebook-integration.html 上的文章非常好

    【讨论】:

    • 谢谢! $cookie['access_token'] 就是我要找的东西!
    • 很高兴听到您正在寻找它。
    猜你喜欢
    • 1970-01-01
    • 2014-05-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-02-16
    • 2017-04-29
    • 2014-03-12
    • 1970-01-01
    相关资源
    最近更新 更多