Verify Facebook Access Token for specific App

前端 未结 4 1187
执念已碎
执念已碎 2021-02-02 16:13

I need to verify that users on my iPhone app are actually logged in to my Facebook app. I\'m able to verify their user id by retrieving it with their Access token:

4条回答
  •  你的背包
    2021-02-02 16:50

    Facebook now provides support for debugging an Access Token. You can retrieve the information related to a particular Access Token by issuing a GET request to the debug_token connection. Something like:

    GET /debug_token?
         input_token={input-token}&
         access_token={access-token}
    

    Where, input-token: the access token you want to get information about and access-token: your app access token or a valid user access token from a developer of the app

    And this will return the following information:

    {
            "data": {
                "app_id": 000000000000000, 
                "application": "Social Cafe", 
                "expires_at": 1352419328, 
                "is_valid": true, 
                "issued_at": 1347235328, 
                "scopes": [
                    "email", 
                    "publish_actions"
                ], 
                "user_id": 1207059
            }
        }
    

    You can get more information about it in the Getting Info about Tokens and Debugging reference.

提交回复
热议问题