Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel Socialite - get user details by token

I'am developing android application with facebook login and laravel REST API server. After user login on mobile, app get token which is sent to my server. On server I want get facebook user details by token.

Facebook SDK for PHP provides methods for that:

$session = new FacebookSession('token');
$me = (new FacebookRequest($session, 'GET', '/me',))->execute()->getGraphObject(GraphUser::className());

Can Laravel Socialite obtain user facebook details based on that token? Or just use that Facebook SDK?

like image 222
Shaddow Avatar asked May 30 '15 08:05

Shaddow


1 Answers

I submitted a pull request to the repo which was accepted to the 2.o branch. You should be able to call Socialte::driver('facebook')->userFromToken($token) now.

https://github.com/laravel/socialite/pull/126

Cheers.

like image 166
Steven M Avatar answered Nov 23 '22 03:11

Steven M