Viewing 15 replies - 1 through 15 (of 21 total)
  • Thread Starter Richard

    (@richardzeng)

    changes I have made:

    line 64:

    add_filter(‘authenticate’, array(‘CASAuthentication’, ‘authenticate’), 10, 3);

    line 85:

    function authenticate($user, $username, $password) {

    line 121:

    return $user;

    Hello, thanks for your reply, and for the timing ??

    I tried what you suggested but I still get an error. Chrome tells me about an error when “extracting” something, followed by the CAS ticker URL. -> Error HTTP 500

    Thread Starter Richard

    (@richardzeng)

    What’s your CAS version?
    I am using CAS 3.4.11.

    Also the version of phpCAS?
    I am using phpCAS 1.3.1.

    Did you get redirected to CAS?
    Can you login?

    Well I found out that curl was not installed on the server and it was the reason for the authentification not working. I’ll test this plugin some more after august 15th and I’ll get back to you if I have some questions ??

    G.

    @richard I’m trying to get this working. The wp-login.php redirects to our CAS login page, which I sign into, but it returns to the wp-login.php page (standard WordPress login page displayed) with a red error box.

    I know my CAS login is successful as I can get to other CAS protected pages.

    Thread Starter Richard

    (@richardzeng)

    Hi BLLuten,

    From your post, I can tell:

    1. your CAS is working
    2. the plugin is working

    things to check:

    in CAS Authentication settings, make sure the CAS.php path is correct. For example, mine is /var/CAS-1.3.1/CAS.php

    if “Auto-register new users?” is off, make sure you login with an existing user, that means before activating this plugin, create a new user with the username you are going to login through CAS.

    Happy to help, good luck.

    Interesting… If I enable “Auto-register new users?” I can log in.

    If I turn it off, I get the expected “ERROR: <username> is not registered with this blog.”

    When this plugin is enabled, if I try to add a new user, I get “ERROR: Please enter your password.”, since the password fields are missing from the add user page.

    If I deactivate the plugin, add a new user, enable the plugin, and try to log in as that user, I get what I described previously: WordPress login page with “ERROR: The password you entered for the username <username> is incorrect.”

    So part of this clearly works, but the way I was hoping to use it doesn’t work for me.

    Thread Starter Richard

    (@richardzeng)

    I think you are very close, just need more luck …

    This plugin disabled password field, if you want to enable it, you can change the plugin code, search for function show_password_fields, return true will enable it.

    For me, if I enable the plugin, I can login via CAS without any problem. Sorry, but, did you make the changes to CAS authentication plugin, as I posted above?

    And maybe you are using a different version of wordpress or phpCAS?

    @Richard- I had tried this plugin without and with the changes you suggested above, before I made my initial post. I’m currently exploring it without your suggested changes.

    I’m using WordPress 3.4.1, phpCAS 1.3.1, & php 5.4.6.

    Changing the return value of the show_password_fields function from false to true doesn’t seem to change the behavior on the add new user page. I’m still exploring (i.e. the add_filter(‘show_password_fields’ action).

    Ack. Ignore the last paragraph in my last post above. Changing the show_password_fields function does work as expected.

    Thread Starter Richard

    (@richardzeng)

    ??

    If I set show_password_fields to true, and use the MD5 of the return value from the passwordRoot function I can now pre-create users for CAS authentication.

    I wonder if its possible to hook the add user page so that this password was used when the show_password_fields was set to false.

    Its been interesting taking this apart. ??

    In regards to the add new user issue, when the password fields are hidden, it looks like the wpCAS plugin addresses this with a hook to check_passwords that sets the password. Seems like CAS Authenticate could be patched in a similar fashion.

    Richard you save my life with your changes to this plugin.
    In my case the login went wrong after changing the password of a CAS user, with yours fix all works good!

    Thanks a lot!!

    Thread Starter Richard

    (@richardzeng)

    Glad it worked for you.

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘to make CAS Authentication working for WordPress 3.4.1’ is closed to new replies.