Yes, this is correct! The idea is that the user is logged in at, for example, Facebook. So you can use that token to log them in again. If that fails then the user should be logged out because they removed the token from that platform.
Socialite Token
I would like to know how you are using the socialite token given by providers.
I mean this:
Socialite::driver('github')->user()->token
or in case of OAuth One where we have also tokenSecret:
Socialite::driver('twitter')->user()->tokenSecret and Socialite::driver('twitter')->user()->token
I see that we can obtain user using:
$user = Socialite::driver('github')->userFromToken($token);
or with OAuth One:
$user = Socialite::driver('twitter')->userFromTokenAndSecret($token, $secret);
I understand that token is something that should not be exposed, so in case I store this on database and on session, I would use decrypt() / encrypt() laravel helper.
It's considered safe to use this by allowing like a remember me checkbox that user can use on safe computer?
So in case user want, each time they enter the website, I check if exist the token (encrypted) and then search in database if exist that token, and in case exist, I can login it automatically.
Can be used in this way? Or I am exposed to a security issue?
Thanks
Please or to participate in this conversation.