Facebook deauthorize my app

前端 未结 6 803
暖寄归人
暖寄归人 2020-12-18 00:40

Can I use Facebook PHP SDK to deauthorize my app for a particular user, basically I like to have a toggle so the user can link or unlink their facebook account to my site, I

6条回答
  •  情歌与酒
    2020-12-18 01:35

    Please note Facebook in the process of deprecating the REST API, and have adding equivalent support to the Graph API User object for "auth.revokeAuthorization" method.

    For delinking or deauthorization the user by making app call:

        $user_id = $this->facebook->getUser();
        $access_token=$this->facebook->getAccessToken();
        $result = $this->facebook->api(array(
                'method' => 'auth.revokeAuthorization',
                'uid' =>$user_id,
                'access_token'=>$access_token
        ));
    

提交回复
热议问题