Auth issues with custom login process
-
Hi,
We have a plugin that enables authentication to a remote API.
It hooks onto the wordpress via the filter ‘authenticate’.
If local user doesn’t exist and we get a positive authentication against our API, a local user is created with a random password.
Now when we use the modal login form, login fails. (Using wordpress normal login works)
I spotted in the models/User.php in the function login() around line 250
As the user may not exist locally and if it does, the local password is unknown, later in this login function it tries to authenticate usingwp_signon()with a passoword + salt.case Settings::LOGIN_FIELD_BOTH:
default:
$user = get_user_by('login', $login);
if (empty($user) OR is_wp_error($user)) {
$user = get_user_by('email', $login);
}replacing this section with something like this seems to do the trick
$user = apply_filters( 'authenticate', null, $login, $password );
return $user;
Thanks for your help.
(Please note my client has purchased the Pro version and I came here as the problem seems the same on the free version and that I don’t have in-hands my client credentials to access the Pro support)
The topic ‘Auth issues with custom login process’ is closed to new replies.