• Resolved pwozniak89

    (@pwozniak89)


    Hi,

    I’m French, sorry for my approximate English ??

    Your plugin seems great but I can’t make it works on my server…

    I’ve set all parameters and “Test Connection” shows me all users I have in my external DB. Great !

    When I try to connect my WordPress with a login/password in external DB it seems to work but nothing happen… only redirection if I set one… But when I try to access pages that are only viewable for logged in users, it tells me I’m not logged in…

    When I turn off plugin (“Enable External Login” not ticked) and I try to connect with external user it shows me that it’s an unknown user. Normal !

    When I look my WordPress users (in Panel or in database) no user was added from my external database. Is it normal ?

    Could you help me to make it works. Really need it.
    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter pwozniak89

    (@pwozniak89)

    More information :
    WordPress 5.5.1
    MySQL 5.7.31
    Passwords encrypted with BCrypt (same issue with “none” and non encrypted password)
    Roles settings are defined

    Plugin Author tbenyon

    (@tbenyon)

    Hey @pwozniak89,

    I can ensure you that your English is way better than my French! ??

    Great that the test connection is working!

    When I try to connect my WordPress with a login/password in external DB it seems to work but nothing happen

    This is a new one that I’ve never had reported. I presume you mean that it is redirecting you to the admin panel when you say it seems to work?

    There are three next steps:

    1. Disable ALL other plugins to ensure that it is not another plugin that is preventing this from working
    2. Share your error logs so we can see if there is anything in there that indicicates what is going on
    3. Ensure this is not a multisite as the plugin has not been tested on it

    Thanks,

    Tom

    Thread Starter pwozniak89

    (@pwozniak89)

    Hi,

    I have disabled all others plugins than External Login and when I try to log with an external login the login page reloads and nothing more…

    No error on Apache’s error.log file

    Don’t have a multisite WordPress

    To let you help me, I would like to send you a test link with user/password.
    So I created a new entry on external database with username “toto” and password “toto”. And before sending it to you, I tried to connect with this credential and IT WORKS !!!

    The problem is that I try to connect with a username that I have already created then deleted on WordPress database…
    Maybe deletion have not removed all information about this account on WordPress database…
    So with toto/toto it works as I have never created a user named toto on WordPress database.

    Sorry for the inconvenience, but I’d like to thank you for this great plugin and your answers that make me think about my mistakes!

    I have one more question:
    Is there a php function I can call on a page that allows me to access directly the external database to read other field for logged user?

    Plugin Author tbenyon

    (@tbenyon)

    Hey @pwozniak89,

    The problem is that I try to connect with a username that I have already created then deleted on WordPress database…
    Maybe deletion have not removed all information about this account on WordPress database…

    This was very interesting to me. What I expect to happen is the user would be overwritten by the external user. I’m going to put in a ticket for myself to see if I can replicate this. I’m wondering if it may be something like the user had the same username but different e-mail or the other way round. Or like you said, that the user was ‘soft’ deleted in some way. I will investigate ??

    Is there a php function I can call on a page that allows me to access directly the external database to read other field for logged user?

    The best way to achieve this is to map additional data as meta fields on the user. This is the WordPress way of storing additional data for a user.

    You could use the exlog_hook_action_authenticated hook to add additional meta fields when they get authenticated.

    The hook pulls in the new wordpress user and all the fields grabbed from the external table on the authenticated user.

    You can find more information on how to use the plugin hooks in the FAQ.

    I haven’t tested this, so treat it like pseudo code, but you could do something like this:

    
    function pwozniak89_exlog_add_additional_user_data($wp_user, $exlog_user_data) {
      add_user_meta(
        $wp_user->ID,                          // User ID
        'fav_colour',                          // WP Meta field key
        $exlog_user_data['favourite_colour'],  // External table data
        false                                  // Not unique
      );
    }
    
    add_action('exlog_hook_action_authenticated', 'pwozniak89_exlog_add_additional_user_data', 10, 2);
    

    This code could live in your functions.php file or where ever you like to store this information.

    Sorry for the inconvenience, but I’d like to thank you for this great plugin and your answers that make me think about my mistakes!

    No problem at all, and I’m glad you’re getting good use from the plugin.

    If it all works I’d be grateful if you could write a review or even buy me a beer.

    Feel free to get back to me if you have any further questions.

    Thanks,

    Tom

    ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Can’t log in’ is closed to new replies.