• Resolved dmsaurabh

    (@dmsaurabh)


    Hi,
    you have made a wonderful plugin. but I am unable to login to website using external wordpress database.

    both database are of wordpress.

    I “test the connection”, it shows all the user and its data. but if i try to login it says “Invalid username or password”

    looking forward positively for solution. Thank you.

    Regards
    Saurabh Raut

    • This topic was modified 4 years, 7 months ago by dmsaurabh.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author tbenyon

    (@tbenyon)

    Hey @dmsaurabh,

    This could be due to a number of reasons.

    Are you using mssql and you are either using a salting method where each user has their own salt OR you are using the EXLOG_HOOK_FILTER_AUTHENTICATE_HASH there is a bug at the moment that is going to be fixed soon.

    If this is not the case, can you please start by checking you’ve definitely selected the correct hashing algorithm?

    If this is all fine, the next thing I’ll ask you to do is to replace the following method in wp-content/plugins/external-login/login/validate_password.php:

    
    function exlog_validate_password($password, $hash, $user_specific_salt) {
            error_log('EXLOG START >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>');
            error_log('EXLOG password-----');
            error_log(var_export($password, true));
    
            error_log('EXLOG password-----');
            error_log(var_export($hash, true));
    
            error_log('EXLOG User specific salt-----');
            error_log(var_export($user_specific_salt, true));
    
            $salt_method = exlog_get_option("external_login_option_db_salting_method");
            $algorithm = exlog_get_option("external_login_option_hash_algorithm");
    
            error_log('EXLOG external_login_option_db_salting_method-----');
            error_log(var_export($salt_method, true));
    
            error_log('EXLOG external_login_option_hash_algorithm-----');
            error_log(var_export($algorithm, true));
    
            $hash = exlog_should_lowercase_hex_hash($algorithm, $hash);
            if ($algorithm == "none") {
                return $password == $hash;
            } else if ($algorithm == "phpass") {
                return wp_check_password($password, $hash);
            } else if ($algorithm == "phpcrypt") {
                return crypt($password, $hash) == $hash;
            } else if ($algorithm == "bcrypt") {
                return password_verify($password, $hash);
            } else {
                if ($salt_method == 'none') {
                    return exlog_hash_password($password, true) == $hash;
                } else if ($salt_method == 'all') {
                    return exlog_hash_password($password, false, $user_specific_salt) == $hash;
                } else {
                    return exlog_hash_password($password) == $hash;
                }
            }
        }
    

    If you then look in your error logs and share the output that will help us start to diagnose the issue further.

    IMPORTANT Please make sure you only do this with a test user as we don’t want personal data shared in the forum!

    Plugin Author tbenyon

    (@tbenyon)

    Hey @dmsaurabh,

    Haven’t heard back from you for a while so I’m going to assume this is resolved.

    If not, don’t hesitate to get back in contact and we’ll see what we can do ??

    Thanks,

    Tom ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Cant login’ is closed to new replies.