I'm trying to get the user's contact information from Facebook. For this I am using the Facebook PHP SDK.
I can generate the login url correctly. However, when I try to get the information I get the error "Malformed access token".
The code I'm currently trying is:
$code = Input::get('code'); // Código que vem na queryString
Session::put('facebook', Input::all());
$facebook = $this->facebook_api_instance();
// Aqui é onde eu passo o código OAuth2 e é gerado um erro
$request = $facebook->request('GET', '/me/friends', [], $code);
$response = $facebook->getClient()->sendRequest($request);