Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akase244/994da73f491419753ea2a804f4bc3bf0 to your computer and use it in GitHub Desktop.
Save akase244/994da73f491419753ea2a804f4bc3bf0 to your computer and use it in GitHub Desktop.
laravel/socialite/src/Two/FacebookProvider.php
protected function getUserByToken($token)
{
$meUrl = $this->graphUrl.'/'.$this->version.'/me?access_token='.$token.'&fields='.implode(',', $this->fields);
if (! empty($this->clientSecret)) {
$appSecretProof = hash_hmac('sha256', $token, $this->clientSecret);
$meUrl .= '&appsecret_proof='.$appSecretProof;
}
$response = $this->getHttpClient()->get($meUrl, [
'headers' => [
'Accept' => 'application/json',
],
]);
return json_decode($response->getBody(), true);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment