duanfei8897 2015-07-09 04:04
浏览 56

PHP Facebook,生成没有访问令牌的应用访问令牌

We have a highscore database setup for our application. We ask the user to login into facebook before their scores are added to the data base, and we use their facebook id to identify their entry in the table. For some reason a bug has occurred and duplicated their highscore. We are unable to figure out what is causing this bug (we can't reproduce it at) but what we do know is that at some point in the process, the last two digits of user's app specific facebook user is set to 0, making it different to their earlyer entry.

My question isn't about the bug (I needed to give the problem context). Our way around this until we can figure out the cause, is it to have a cron job look for any duplicate name and email address, then look at each facebook id in the entries and determine which of the two is valid and which is not.

As of now after looking up the documentation, I can generate an app access token with the following api call : https://developers.facebook.com/docs/facebook-login/access-tokens#apptokens. However the php object that allows me to make a request to facebook requires an access token (via a session) https://developers.facebook.com/docs/php/FacebookRequest/4.0.0. The documentation I've found making an api request to get an app access token are all out of date, as the version of the sdk they were using was depreciated.

So, as it understand it, I need an access token to generate an access token. There must be a way to get an app access token

(If i have any misunderstanding of the documentation, please post it as a comment so I can improve the question)

  • 写回答

1条回答 默认 最新

  • douyi3676 2015-07-09 07:21
    关注

    You can either generate an app access token as outlined at

    with the call

    GET /oauth/access_token?
         client_id={app-_id}
        &client_secret={app_secret}
        &grant_type=client_credentials
    

    or just use the concatenated app id and app secret like this:

    {app_id}|{app_secret}
    

    The {app_id} and {app_secret} can be found at you app's setting at

    评论

报告相同问题?

悬赏问题

  • ¥15 thinkphp6配合social login单点登录问题
  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch