Moving (back) to LDAP Auth, would like to migrate passwords

Need help? Post your questions here.
hairlesshobo
Posts: 3
Joined: 17 Jul 2013, 01:53
Has thanked: 0
Been thanked: 1 time

Moving (back) to LDAP Auth, would like to migrate passwords

Unread post by hairlesshobo »

OK, so back in the day (pre madsonic days) I used to authenticate against my LDAP database which worked great. Well at the time, I shut down my local linux box and did away with LDAP authentication. This was a pain because everyone who had an account had to be recreated and their password reset. What I would like to know is.. is there any way that I can migrate the passwords that are encrypted in the database to OpenLDAP. Fortunately, OpenLDAP supports a number of different password encryption schemes, so if I at least knew what algorithm was used in the MadSonic database, I might be able to simple use the password as is and just let the LDAP directory know what type of encryption it is. Second option, if the encryption that is used for Madsonic users happens to NOT be supported by OpenLDAP, is the encryption algorithm used a one-way algorithm (like MD5 is) or is there some way that I could decrypt the passwords in order to re-encrypt them to what my database already uses and then migrate them over to OpenLDAP. I am just trying to avoid making all my users go in and change their passwords again because I really want it to be as seamless as possible.

Thanks in advance for any pointers that you can give!

-Steve
hairlesshobo
Posts: 3
Joined: 17 Jul 2013, 01:53
Has thanked: 0
Been thanked: 1 time

Re: Moving (back) to LDAP Auth, would like to migrate passwo

Unread post by hairlesshobo »

Well, after posting this last night I was able to find that the passwords stored in the user table are not encrypted, they are actually converted for utf8 hex and then stored. This made it very easy for me to write a PHP script that is able to convert that back to ascii and then I was able to use that information to create all of my users in LDAP, and then I simply ran an update against the user table to mark all users (except one i created as a backup account) to mark them all for authenticate through LDAP. Tested with multiple accounts and it worked perfect. Hope this helps someone else in the future.
These users thanked the author hairlesshobo for the post:
Madsonic
Rating: 7.69%
Post Reply