Home › Forums › OS X Server and Client Discussion › Open Directory › Password Change with PHP
- This topic has 3 replies, 1 voice, and was last updated 20 years ago by
Anonymous.
-
AuthorPosts
-
October 13, 2006 at 3:18 pm #367271
Anonymous
GuestHi,
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.
October 16, 2006 at 1:05 pm #367287gw1500se
ParticipantNo, 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.
October 22, 2006 at 11:03 pm #367366Anonymous
GuestWe 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: SorryIf 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.
October 22, 2006 at 11:43 pm #367367Anonymous
Guestdscl -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.
-
AuthorPosts
- You must be logged in to reply to this topic.