• Hello,

    I’m using MySQL database as external “password not hashed its plain text”, on login attempt for the first time if it authenticated it gives wrong password although it
    do insert the record inside WordPress users table, the second attempt let you login!, how can i make the user login from the first attempt when he has record on the external database but no record in WordPress users database ?

    thanks in advance ,,

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter Abdallah Abu Faris

    (@abufaris)

    PS: I’m using ULTIMITE-MEMBER plugin the error msg when the first login attempt:

    #: includes/core/um-actions-login.php:59
    msgid “Password is incorrect. Please try again.”

    Plugin Author tbenyon

    (@tbenyon)

    Hey @abufaris,

    This appears to be working fine on my local installation. I’ve just tested twice by setting the hashing type to none, creating a new user in the external database and logging in.

    Both times I was logged straight in and the new user was created.

    I don’t know what the Ultimate Member plugin does, but your first step to debugging would be to disable all your other plugins and see if this then works for you.

    Let me know how you get on with this.

    Thanks,

    Tom ??

    Thread Starter Abdallah Abu Faris

    (@abufaris)

    hey @tbenyon (Tom),

    Ultimate Member is a user profile & membership plugin for WordPress it provides custom login forms may be it cant hook the authentication from exlog_hook_action_authenticated.

    thanks for your effort ??

    Plugin Author tbenyon

    (@tbenyon)

    No worries, had a quick look into the plugin.

    The External Login plugin uses WordPress’ authenticate hook change how the username and password are validated in the plugin.
    add_filter('authenticate', 'exlog_auth', 10, 3);

    It appears that Ultimate Member also use this hook in this line of code:
    add_filter( 'authenticate', 'um_wp_form_errors_hook_ip_test', 10, 3 );

    The 10 shown in both is the priority in which these should be called. Because they are the same, and hearing the experience you are getting, I imagine that the other plugin is winning the race.

    However, I speculate that if you changed the value to a 9 in the External Login plugin, you may find this solves your problem.

    HOWEVER, I would strongly encourage you to test this fully as I do not know what other checks are happening.

    If you did want to try this and see if it fixes your issue, you can make this change in the following file in the plugin:
    external_login/login/authenticate.php

    If this does work for you, I could add a tweak to my code that allows you to specify the priority number. I wouldn’t want to change the value for everyone as it may be that it being set to 10 is what is making it work for other users different plugins.

    If you do a test and it works let me know ??

    Thanks,

    Tom

    Thread Starter Abdallah Abu Faris

    (@abufaris)

    Hello,

    ive tried to change it but with no luck also i tried to make wait time before the call of the function also no luck ill keep trying.

    thank you so much ,,,

    code:

    if (exlog_get_option(‘external_login_option_disable_local_login’) == “on” || is_wp_error($user)) {
    remove_action(‘authenticate’, ‘wp_authenticate_username_password’, 20);
    }
    }

    return $user;
    }

    sleep(2);

    if (exlog_get_option(“external_login_option_enable_external_login”) == “on”) {
    add_filter(‘authenticate’, ‘exlog_auth’, 9, 3);
    }

    Plugin Author tbenyon

    (@tbenyon)

    Yeah – I wouldn’t expect the sleep to work but worth a try.

    As we think this is a compatibility issue with another plugin you’re using I’m going to mark this as resolved as it’s not an issue with this plugin.

    However, if anything leads you to believe this is not the case or if you have other thoughts or questions you want to discuss, please feel free to message back here ??

    Thanks,

    Tom

    Thread Starter Abdallah Abu Faris

    (@abufaris)

    Hello,

    I agree its compatibility thing not a bug ill try to find work around if I found something interesting ill share it here.

    Thank you ??

    Plugin Author tbenyon

    (@tbenyon)

    Awesome! Much appreciated @abufaris.

    Good luck with your investigation!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘After authenticate first time gives wrong password!’ is closed to new replies.