braed
1 year ago

Socialite Login: This password does not use the Bcrypt algorithm

Posted 1 year ago by braed

I have added Socialite social authentication to my Laravel 5.7 project, updating the User model to have a nullable password since OAuth2 doesn't require a password.

Trying to login to the account made via Socialite using the same email and any password gives a This password does not use the Bcrypt algorithm. exception.

It seems that the algoName in the following method in BcryptHasher is returning unknown.

public function check($value, $hashedValue, array $options = [])
{
    if ($this->info($hashedValue)['algoName'] !== 'bcrypt') {
        throw new RuntimeException('This password does not use the Bcrypt algorithm.');
    }

    return parent::check($value, $hashedValue, $options);
}

I'm not sure how to see what is calling check() in order to debug further but it's certainly related to Socialite.

Please sign in or create an account to participate in this conversation.