Ash*_*fny 1 android google-authentication jwt laravel laravel-socialite
我有一个 Android 应用程序,它使用 google 身份验证来注册用户
,我正在使用它laravel socillite进行身份验证
我无法让它工作,因为 android 应用程序向我发送了授权代码而不是访问令牌,而且我不知道如何从中获取访问令牌根据Authorization Code
我的理解,我应该执行以下操作:
access token从 android获取Authorization CodeSocialite::driver('google')->userFromToken($token)获取用户数据JWT到 Android 设备laravel socillite 我确实通过使用getAccessTokenResponse如下函数解决了这个问题:
$access_token = Socialite::driver($provider)->getAccessTokenResponse($token);
$user = Socialite::driver($provider)->userFromToken($access_token['access_token']);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3670 次 |
| 最近记录: |