Forums

Authentication does not work when LDAP Plugin is activated

  1. I've been reading up on how to get the Blackberry Wordpress App connected to my blog. Like many people, I was receiving an error about the xmlrpc file. Turns out, in "Setup" I had to disable the "Blackberry Internet Service" as one of the connection options, and that did the trick.

    But now I'm receiving the following error message whenever I go to "Add Blog":

    "Blog Message (code 403) Bad login/pass combination."

    It turns out I only get the 403 error when I have an authentication plugin enabled. To give a little background, I wrote a plugin that lets WP authenticate off of Windows Active Directory.

    That authentication plugin has been working fine for a few weeks, and I'd prefer if I didn't have to disable it.

    So basically, Wordpress can authenticate users off of Active Directory using my plugin, but the Blackberry App cannot. If I disable the AD plugin then the Blackberry App can authenticate users using WP's users table.

    So now the question is, is there any way to get the Blackberry App to recognize plugins that have an effect on the authentication process? I know that this setup probably isn't common, but really, having to manage a separate user list for every web app on the network isn't realistic. So I'd really prefer to be able to authenticate off of a central ldap directory.

    I'm not sure if the authentication process is built into the Blackberry App itself, or if I have to update the authentication process in the xmlrpc.php file. Any advice or help would be greatly appreciated.

    From what I've seen so far the Blackberry App looks great. So if there's a way to also get it to recognize activated plugins that would be really cool.

    Thanks!

  2. Well I think I answered my own question. I opened up the xmlrpc.php file and wouldn't you know it, there's a function named:
    login_pass_ok()

    which does the following check:

    if (!user_pass_ok($user_login, $user_pass)) {
    $this->error = new IXR_Error(403, __('Bad login/pass combination.'));
    return false;
    }

    I'll hack at the functions tomorrow to see if I can get the xmlrpc connections to authenticate off of Windows Active Directory just like a standard Wordpress wp-login.php login attempt.

    Cheers!

  3. '

    Turns out, in "Setup" I had to disable the "Blackberry Internet Service" as one of the connection options, and that did the trick.

    Thanks that did the trick, and am not having this issue as I don't have your plugin, but yes it works fine with all my blogs, and with josephscott's xmlrpc file that he sent, ... interesting thanks again for the heads up ...

  4. I've updated the xmlrpc.php file so xmlrpc can now authenticate off of Windows Active Directory. It was pretty straight forward. I'm running Wordpress 2.8.2 so the xmlrpc.php login function I had to modify was login() and not login_pass_ok().

    All I really had to do was comment out:
    $user = wp_authenticate($username, $password);

    And add:
    $user = my_custom_authentication_function($username, $password);

    The custom authentication function is the same function that I used in my Wordpress Active Directory plugin so implementing the plugin into the xmlrpc.php file was pretty painless.

    Hopefully others will find this thread useful.

    Cheers!

  5. @snoll -- glad you got it to work and thanks for sharing your tweaks.

  6. I found that the 403 can be caused if you have never changed your wordpress generated password as well.

  7. @snoll
    You shouldn't need to edit the xmlrpc.php file at for your plugin to change authentication. The wp_authenticate() function is pluggable and can be completely replaced (or filtered if you want to fall back to pure WP auth).

  8. I am having a similar problem with my Blackberry Curve 8330. When I enable the XML-RPC, it returns a Code 403 (Bad login/password). When I disable it, it tells me that I don't have it enabled. I can't win! Everything seems open - everything is set to allow the application to access Wordpress. Is there anything else I can do?

Topic Closed

This topic has been closed to new replies.


About this Topic