Reputation: 538
I've an Android app that use google authentication to register users
and I am using laravel socillite
for the authentication
I can't get this to work because the android app send me an authorization code not the access token and I do't know how can I get the access token from that Authorization Code
From my understanding I should do the following:
access token
from android Authorization Code
Socialite::driver('google')->userFromToken($token)
to get user data JWT
token to the android device laravel socillite
Upvotes: 1
Views: 4198
Reputation: 538
I did solve this by using a getAccessTokenResponse
function as the followoing:
$access_token = Socialite::driver($provider)->getAccessTokenResponse($token);
$user = Socialite::driver($provider)->userFromToken($access_token['access_token']);
Upvotes: 5