Hello my friend!
I have the same scenario here. Did you solve this? How?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello guys,
I developed an API with Laravel Passport that will be used for a mobile app. Everything is working flawlessly but then I started working on Social Network logins (Facebook and G+) in the app and well, I stumbled on the following problem:
When using the grant type = Password it requires a password and Facebook wont provide it and I am afraid of the security issues on using a generated "info hashed" password. I already tweaked the Passport to search for the user by its social network ID with this code on the User model:
public function findForPassport($username)
{
$user = $this->where('email', $username)->first();
if(!$user)
{
$user = $this->where('social_network_id', $username)->first();
}
return $user;
}
But the next step on the \passport\src\Bridge\UserRepository.php is where I need help.
It checks for this condition below and guess what? The $user does not have a password to check since its a social network login.
if (! $user || ! $this->hasher->check($password, $user->password))
What would be your suggestions for this issue? I believe it would be possible to implement my own UserRepository but if so, how would I bind it my with own version of this repository class?
Please or to participate in this conversation.