Title: After authenticate first time gives wrong password!
Last modified: October 5, 2020

---

# After authenticate first time gives wrong password!

 *  Resolved [Abdallah Abu Faris](https://wordpress.org/support/users/abufaris/)
 * (@abufaris)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/after-authenticate-wrong-password/)
 * 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 ,,
    -  This topic was modified 5 years, 8 months ago by [Abdallah Abu Faris](https://wordpress.org/support/users/abufaris/).
    -  This topic was modified 5 years, 8 months ago by [Abdallah Abu Faris](https://wordpress.org/support/users/abufaris/).

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Thread Starter [Abdallah Abu Faris](https://wordpress.org/support/users/abufaris/)
 * (@abufaris)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/after-authenticate-wrong-password/#post-13492818)
 * 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](https://wordpress.org/support/users/tbenyon/)
 * (@tbenyon)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/after-authenticate-wrong-password/#post-13493103)
 * Hey [@abufaris](https://wordpress.org/support/users/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](https://wordpress.org/support/users/abufaris/)
 * (@abufaris)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/after-authenticate-wrong-password/#post-13493209)
 * hey [@tbenyon](https://wordpress.org/support/users/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](https://wordpress.org/support/users/tbenyon/)
 * (@tbenyon)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/after-authenticate-wrong-password/#post-13493333)
 * 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](https://wordpress.org/support/users/abufaris/)
 * (@abufaris)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/after-authenticate-wrong-password/#post-13493544)
 * 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](https://wordpress.org/support/users/tbenyon/)
 * (@tbenyon)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/after-authenticate-wrong-password/#post-13493987)
 * 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](https://wordpress.org/support/users/abufaris/)
 * (@abufaris)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/after-authenticate-wrong-password/#post-13496623)
 * 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](https://wordpress.org/support/users/tbenyon/)
 * (@tbenyon)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/after-authenticate-wrong-password/#post-13496813)
 * Awesome! Much appreciated [@abufaris](https://wordpress.org/support/users/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.

 * ![](https://s.w.org/plugins/geopattern-icon/external-login_fbebd6.svg)
 * [External Login](https://wordpress.org/plugins/external-login/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/external-login/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/external-login/)
 * [Active Topics](https://wordpress.org/support/plugin/external-login/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/external-login/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/external-login/reviews/)

 * 8 replies
 * 2 participants
 * Last reply from: [tbenyon](https://wordpress.org/support/users/tbenyon/)
 * Last activity: [5 years, 8 months ago](https://wordpress.org/support/topic/after-authenticate-wrong-password/#post-13496813)
 * Status: resolved