• Good day ??

    I’m attempting to use the External Login Plugin but experiencing problems.

    I have created my own MySQL User table and successfully mapped over the fields required and tested it via the plugin. I manually inserted into my own MySQL User table a user account with a generated bcrypt hashing. I have also successfully logged into word press using this external user and password.

    However, the plugin does not create a user record in the word press table “wordpress_auto_users”. Can you please help me understand why this is not working.

    Thanks

    Mark

Viewing 1 replies (of 1 total)
  • Thread Starter mrvirtuoso180

    (@mrvirtuoso180)

    I managed to debug the plugin and fix the issue. My issue was that the test data i used had the same email as my root user. Therefore i was getting “Sorry, that email address is already used!”. But if you just activate this plugin, error like this fail siliently.

    There

    1. Go to your /public/wp-config.php folder and set WP_DEBUG to true

    2. Then add so that is output logs to /wp-content/debug.log

    define( ‘WP_DEBUG_LOG’, true );

    3. Go to your /plugins/external-login/login/authenticate.php

    Add this additional conditional is_wp_error to display any errors if the insert into the wp table occurs.

                    
    
                    // Setup the minimum required user information
    
                    $new_user_id = wp_insert_user( $exlog_userdata ); // A new user has been created
    
    // ADD THIS TO CONDITION TO DISPLAY ERROR
    
                    if ( is_wp_error( $new_user_id  ) ) {
                       echo $new_user_id->get_error_message();
                       error_log(__FUNCTION__ . "\n" . print_r($new_user_id->get_error_message(),1));
                    }
    
    
    
                    // Load the new user info
                    $user = new WP_User ($new_user_id);

    4. Finally, Check your /public/wp_content/debug.log

    In my case

    [18-Aug-2023 12:22:12 UTC] exlog_auth
    Sorry, that email address is already used!

    5. Lastly, Dont forget to set WP_DEBUG to false

    Enjoy!

Viewing 1 replies (of 1 total)
  • The topic ‘WordPress Authenticates but No User Record Created’ is closed to new replies.