Forum Replies Created

Viewing 15 replies - 271 through 285 (of 574 total)
  • Plugin Author tbenyon

    (@tbenyon)

    Hey @stikekar,

    I’m afraid I’m not allowed to give out private details on the forum. I was told off when I started the plugin for doing it by the moderators.

    That looks right to me, I haven’t tested it on my local copy.

    As I said before, you may want to add another log to the start of your functions.php file to ensure logs are working at all first.

    e.g. error_log(‘EXLOG———————–>>>> START of functions.php’);

    Let me know when you get your logs showing 🙂

    Tom

    Plugin Author tbenyon

    (@tbenyon)

    You could try adding an error_log to the top of your functions.php file to see if we’re not getting to where we put the logs in the other file.

    At that point, if you can’t see the log there’s not a lot I can do to help you as it’s really about your server configuration. You could ask your hosting provider for help locating the logs.

    Plugin Author tbenyon

    (@tbenyon)

    It varies based on your setup. This may help you:
    https://www.loggly.com/ultimate-guide/php-logging-basics/

    Plugin Author tbenyon

    (@tbenyon)

    No worries @stikekar and thanks for getting back with more info. All sounds good to me.

    The next route of debugging this issue is to look at the data coming back from your database and check that it is what you expect to see.

    I’m going to ask you add some additional logging into the app.

    IMPORTANT!!! This will log the personal information of the user that you are fetching information for. For this reason, you should do this with test data to ensure that your users’ information does not appear in your logs.

    Please look for the following while loop at line 131 in the following path:
    wp-content/plugins/external-login/plugin-files/login/db.php

    Below is the same code with some additional log lines.

    
    while( $userData = sqlsrv_fetch_array($stmt)) {
        error_log('EXLOG----------------------->>>> START');
        $user_specific_salt = false;
    
        if (exlog_get_option('external_login_option_db_salting_method') == 'all') {
            $user_specific_salt = $userData[$db_data["dbstructure_salt"]];
        }
    
        error_log('EXLOG----------------------->>>> 1');
        error_log(var_export($userData, true));
        $valid_credentials = exlog_validate_password($password, $userData[$db_data["dbstructure_password"]], $user_specific_salt);
        
        error_log('EXLOG----------------------->>>> 2');
        error_log(var_export($valid_credentials, true));
        if ($valid_credentials) {
            $wp_user_data = exlog_build_wp_user_data($db_data, $userData);
            $wp_user_data["exlog_authenticated"] = true;
            return $wp_user_data;
        }
        error_log('EXLOG----------------------->>>> END');
    }
    

    Please update the code to look like this and then come back to me with the answer to these questions:

    • Did you see the logs messages appear in your logs?
    • Does the hash in the logged data match the hash that is stored for your user with the updated password?

    Thanks,

    Tom

    Plugin Author tbenyon

    (@tbenyon)

    Hey @stikekar,

    Sounds like you’ve done the right thing and your expected behaviour is in line with mine. Let’s see if we can solve it together 🙂

    I know this is working for myself and other users so my first question is, what manages the external db system? Laravel, another WordPress site, a custom made system?

    I ask because one thought is that new passwords are being upgraded to a new hashing system in a different column? I’ve seen this before.

    Does the old password continue to work on the WordPress database?

    Does the new password definitely work on the external system?

    If none of this triggers a solution for you I’ll suggest where we can add some debugging lines in the plugin to look deeper.

    Tom

    Plugin Author tbenyon

    (@tbenyon)

    Hey Steve,

    Locked myself out of WordPress so many times during development ☺️

    I feel the pain!!! 😊

    Yep! Lived in Burgess Hill forever. I’ve got so much family here I can’t leave …and the last couple of weeks has given another factor keeping me locked here ☺️

    Thank you for generosity! Genuinely made my day. 😊 I’m actually going to use it for a Beer52 order.😊

    If you have any further issues please don’t hesitate to get in contact.

    Stay safe 😊

    Tom

    Plugin Author tbenyon

    (@tbenyon)

    Hey @rayge,

    The plugin simply tries to log a user in to a site they are visiting by looking at an external database that has been defined in the settings.

    Unlike you described, the user would be directly visiting the child site, using the login screen there, but a query would be sent to a different database to validate the user.

    Plugin Author tbenyon

    (@tbenyon)

    Hey @gonzosdrummer,

    The plugin will always try and find the user on the external system first. If they can be found, they are validated and because you disabled them they would no longer be authenticated.

    However, if the user is not found, or if the connection to the external data fails, the plugin will fall back to login users with the WordPress database (at which point they would be validated). You can however disable falling back to local login. There is a check box for this.

    If you have any further issues or questions please get back to me 😊

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

    Thanks!

    Tom

    Plugin Author tbenyon

    (@tbenyon)

    Hey @gassi,

    What do you suggest as a solution?

    If the username is unique but the e-mail is not, block the user from logging in?

    Genuinely welcome your feedback and thoughts on a solution. 🙂

    Tom

    Plugin Author tbenyon

    (@tbenyon)

    Hey @gassi,

    Apologies for the delay in getting back to you.

    Sounds like you’ve solved your problem – awesome 🙂

    Thanks,

    Tom

    Plugin Author tbenyon

    (@tbenyon)

    Hey @deqko,

    Apologies for not getting back to you sooner.

    Been a busy week but trying to catch up with the support forum today 🙂

    It is not currently possible. However I could add a hook in for you that would fire so you could customise the data that gets stored when updating the user.

    This would mean that you could change the role to the current role.

    Would this be of interest to you? If so I can add this feature to the backlog and I’ll give you a code snippet to make the specific change you require.

    Thanks,

    Tom

    Plugin Author tbenyon

    (@tbenyon)

    Hi @blazer380,

    Unfortunately I don’t. Due to the huge number of different database providers out there I can’t provide these details for every system. However, if you go to the settings page of the plugin you will see the details that you will need to fill in.

    In the first instance, all you’ll have to find is the hostname, database name, database user, database password and port.

    Your provider should be able to give you this information.

    If any questions about the plugin please don’t hesitate to get back in contact.

    Thanks,

    Tom 🙂

    Plugin Author tbenyon

    (@tbenyon)

    Hey @philengel,

    Just checking in to see if you got any further 🙂

    Thanks,

    Tom

    Plugin Author tbenyon

    (@tbenyon)

    Hey @axharkhan,

    Just wanted to update you. I’ve done a fair bit of reading and have gained a fair bit of understanding but I just don’t have the time to keep investing in this right now. It would involve me reading up a lot more on C# and then have to implement that in PHP.

    I do have a ticket for this in the backlog so I hope to get round to it in the future.

    I think if you need this now your best option is to pay a developer to write this part of the solution (unless you have the time to learn it yourself and implement it yourself). I am not allowed to offer paid work here unfortunately but I think this is something someone would happily pick up. Probably quite straight forward for someone with more C# understanding than I.

    What you would need is someone that can write a PHP function that takes the hash you gave me in the last message, and a string for a password. It would then return true if the user was valid or false if it was not.

    This is then easily implemented for you without any changes to the plugin. You can find some basic information how in the FAQ about hooks on the plugin but it would looks something like this:

    
    function myExlogHashAuthenticator($password, $hashFromDatabase) {
        return someFunctionToCheckHashAgainstPassword($password, $hashFromDatabase);
    }
    
    add_filter('exlog_hook_filter_authenticate_hash', 'myExlogHashAuthenticator', 10, 2);
    

    If you did get someone to get this far, and you wanted the code added to the plugin, feel free to share it back here and, as long as it is the standard implementation for all ASP.net users, I’ll add in settings for it.

    Thanks @axharkhan,

    Tom

    Plugin Author tbenyon

    (@tbenyon)

    Hey @axharkhan,

    Don’t apologise, I’m really glad you managed to find the issue. Well done! 🙂

    Plus you helped me find a small flaw in the plugin which is great!

    If you get a minute to write a review I’d be very grateful. 🙂

    Regarding the hash, you sending me that link did teach me something else which is that I now realise that the salt is stored with the password it appears (which is good).

    Again, if you can create a new user with password password and send me the created hash for that user it would help me test the issue.

    Thanks,

    Tom 🙂

    • This reply was modified 6 years, 5 months ago by tbenyon.
Viewing 15 replies - 271 through 285 (of 574 total)