Problem getting access_token after migrating to OAuth 2.0

前端 未结 4 836
清酒与你
清酒与你 2021-01-05 16:18

I have tried migrating my app to the OAuth 2.0 routine. I am having trouble getting the access_token from the cookie set by the JavaScript API. I decode the information in t

4条回答
  •  暖寄归人
    2021-01-05 16:52

    Unfortunately I don't have the answer directly, but I do have a documentation bug that I filed against facebook in order to try to get the documentation there: http://bugs.developers.facebook.net/show_bug.cgi?id=20363

    I have a similar problem that when I try to decode the signedRequest from the authResponse of FB.login, they payload contains something like:

    {"algorithm":"HMAC-SHA256","code":"THE_CODE_HERE","issued_at":1315433244,"user_id":"THE_USER_ID"}
    

    As you stated, the docs do talk about how to turn that code into an access_token. That appears to be in the "Server Side" documentation here: http://developers.facebook.com/docs/authentication/

    If you grab the accessToken from FB.login you can get it from the js and cache it, but as you said, that isn't actually signed, and could relatively easily be faked.

    And you're right, this doesn't appear to have any of the useful information that's described here: developers.facebook.com/docs/authentication/signed_request/ (http removed since I don't have enough reputation points yet to post more than 2 links - sorry)

    Perhaps you can vote up my bug? I'll post this link on that bug too.

提交回复
热议问题