Forums

[resolved] XML-RPC authentication fails with LDAP plugin... (6 posts)

  1. kojix
    Member
    Posted 1 year ago #

    We are using the Simple LDAP Authentication plugin to authenticate users into our blog network without problems.

    Today, we decided to try the iOS app for wordpress, and we see that the autentication process fails (user/passwd incorrect)...

    The XML-RPC publish propertie is set to on...

    I've tried to put an error_log message into the authentication plugin, and i can see that the plugin is not executed for the xmlrpc authentication process.

    I check the xmlrpc.php file, and I see that the authentication is performed by the user_pass_ok function, wich calls wp_authenticate (hooked by the ldap plugin), so I don't understand what is happening...

    Does the xmlrpc authentication procedure bypass the plugins??

  2. kojix
    Member
    Posted 1 year ago #

    No answers?
    Any clue on what could be wrong?

    I've tried to set a password on the database for the test user (by default the plugin set a random one), and then I can log in...

    Thanks in advance...

  3. Aaron Axelsen
    Member
    Posted 1 year ago #

    This is fixed in the 3.1 version (at least in my testing).

    This fix should fix the xmlrpc issue:

    http://wpmu-ldap.svn.sourceforge.net/viewvc/wpmu-ldap/trunk/ldap/lib/wpmu_ldap.functions.php?r1=116&r2=115&pathrev=116

  4. tianon
    Member
    Posted 1 year ago #

    I'm also using the "Simple LDAP Authentication" plugin, and am using 3.1, but have the same issue. Can login from the site using LDAP, but not from XML-RPC. Local users work fine in XML-RPC.

  5. tianon
    Member
    Posted 1 year ago #

    Applying the following patch to wp-includes/class-wp-xmlrpc-server.php solved our problem:

    diff --git wp-includes/class-wp-xmlrpc-server.php wp-includes/class-wp-xmlrpc-server.php
    index 5e9bbd4..9a24187 100644
    --- wp-includes/class-wp-xmlrpc-server.php
    +++ wp-includes/class-wp-xmlrpc-server.php
    @@ -182,6 +182,7 @@ class wp_xmlrpc_server extends IXR_Server {
                            return false;
                    }
    
    +               do_action_ref_array('wp_authenticate', array(&$username, &$password));
                    $user = wp_authenticate($username, $password);
    
                    if (is_wp_error($user)) {

    Just needed to process "login" in the same way as user.php to allow Simple LDAP Authentication's wp_authenticate plugin to do its dirty work.

  6. kojix
    Member
    Posted 1 year ago #

    I tried with 3.0 and it wasn't working, but now with 3.1 it works fine!!!

    Thank you!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags