[英]Laravel Socialite Access Token And Token
I need help about laravel socialite.我需要有关 Laravel 社交名媛的帮助。
I use google service to pre-autheticate my app.我使用谷歌服务来预认证我的应用程序。
Socialite::driver('google')->user()->token
Is the above token equal to the Google access token?上面的令牌是否等于谷歌访问令牌?
Yes it is the access token.是的,它是访问令牌。 socialite uses authorization code to retrieve accesstoken.
社交名流使用授权码来检索访问令牌。
If you want to verify , do like this如果要验证,请执行以下操作
$token = Socialite::driver('google')->user()->token
$user = Socialite::driver('google')->userFromToken($token);
From the Laravel Socialite docs:来自 Laravel Socialite 文档:
Socialite::driver('google')->user()
returns your user object/model. Socialite::driver('google')->user()
返回您的用户对象/模型。 So, Socialite::driver('google')->user()->token
returns the token on your user model.因此,
Socialite::driver('google')->user()->token
返回用户模型上的令牌。
Unless you stored the google access token on your user model, this is not the Google access token
除非您在用户模型上存储了 google 访问令牌,否则这不是 Google 访问令牌
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.