Home Forums OS X Server and Client Discussion Open Directory Password Change with PHP

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #367271
    Anonymous
    Guest

    Hi,
    My workplace is deploying a groupware system which, unfortunately, doesn’t integrate with LDAP for authentication.* One of my coworkers is writing a web application to automate changing passwords in both OD and the groupware. Is there a way to do this with using PHP’s ldap functions (http://php.net/ldap) ? I know that in a normal OpenLDAP implementation we would be able to do this by changing an attribute (eg- http://logout.sh/computers/ldap/); will this work with OD and the Password Server?

    Thanks.

    #367287
    gw1500se
    Participant

    No, at least I was never able to get it to work nor was anyone here able to help me. Use ‘dscl’ from your php page.

    #367366
    Anonymous
    Guest

    We tried using the ldappaswd command (sanitized below). Before even putting it on the web server, which is a linux box, we tested it on the OD host with the invocation below (sanitized to remove site info.)

    ldappasswd -A -D uid=testuser,cn=users,dc=organization,dc=com -H ldap://organization.com -S -W -x

    We were then prompted for 5 things.

    1 Old password:
    2 Re-enter old password:
    3 New password:
    4 Re-enter new password:
    5 Enter LDAP Password:

    If I enter the wrong value for 5 it reports ldap_bind: Invalid credentials (49). If I enter non-matching values for 2 and 3 or 4 and 5 this is caught.

    If I enter the correct values, it returns, Result: Success (0). If I enter the wrong values for 2 and 3 it still reports Result: Success (0).

    Unfortunately the password did not actually change. If I try to su with the new passwod, this happens.

    su testuser
    Password:
    su: Sorry

    If I take off the -S flag to have it automatically set a password, I see this
    ldappasswd -A -D uid=testuser,cn=users,dc=organization,dc=com -H ldap://organization.com -W -x
    Old password:
    Re-enter old password:
    Enter LDAP Password:
    New password: ga7uXbUN
    Result: Success (0)

    Again, the password did not actually change. Can anyone suggest why this is failing? Using -v reveals no useful information.

    #367367
    Anonymous
    Guest

    dscl -u $USER -P $OLDPASS /LDAPv3/127.0.0.1 -passwd /Users/$USER $OLDPASS $NEWPASS works if we log in to the OD server, which isn’t ideal but may have to do. This http://sourceforge.net/projects/osxpass also looks interesting.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

Comments are closed