Closed (fixed)
Project:
LDAP integration
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
5 Feb 2009 at 17:32 UTC
Updated:
25 Feb 2009 at 01:00 UTC
I have disabled the "Do not store users' passwords during sessions" checkbox in "Administer -> Site configuration -> LDAP Authentication -> Settings -> Security Options". According to the documentation next to this setting, this should allow the ldapauth module to store the user's LDAP password in clear text during the session, in the session table of Drupal's database.
When I login as a LDAP user (uid > 1) and view the Drupal MySQL databse in phpMyAdmin, the session table does not contain any clear-text password. Where can I find it? I'm looking for it to establish SSO from Drupal to Moodle.
Comments
Comment #1
roball commentedCould someone please shine a light on this?
Comment #2
rmiddle commentedroball,
User Number 1 will always use drupal local datebase that way if something goes wrong with your ldap setup you can login as "root" to fix things. Create a user Number 2 and you should see there password in clear text.
Thanks
Robert
Comment #3
roball commentedThank you Robert for replying. I know that the superadmin user (uid == 1) will always be authenticated by Drupal's built-in login method. That's why I wrote "When I login as a LDAP user (uid > 1) and view the Drupal MySQL database". My question is still where I could see the password in clear text.
Comment #4
rmiddle commentedsorry roball I miss read your message. The password is likely stored in a serialized format. Are you running the data stored in the table though unserialize and I would guess you will see the password right there.
Thanks
Robert
Comment #5
roball commentedIs the password supposed to be stored in the "session" field of the "sessions" table?
When I login as user with the uid 2 and view the "sessions" table afterwards, the row with the "uid" value 2 has the following content in the "session" field:
CiviCRM|a:4:{s:10:"lcMessages";s:5:"en_US";s:4:"ufID";s:1:"2";s:6:"userID";s:3:"105";s:8:"ufUniqID";s:0:"";}I cannot see where the password should be.
Thanks for trying sorting this out.
Comment #6
rmiddle commentedbased on that you password would be the field "ufUniqID". I would guess that is an MD4 hash of your password. i don't have cain and able handy but I am pretty sure it would take only a few min to crack that password hash.
Thanks
Robert
Comment #7
roball commentedI'm getting more confused. Where is the value of this "ufUniqID" field?? And according to the ldapauth module's documentation, Physically, these passwords are stored in the Drupal's session table in clear text.
There is not even a table called "session" in Drupal's MySQL database - the table I mentioned is called "sessions".
Comment #8
rmiddle commentedNo your password is "ufUniqID". Yes it is sessions. The entire data structure is converged using "serialize" into 1 string that is stored inside that table. Serialize converts data from an array into a string that can be stored safely. I have looked at the output of serialize enough to know that the hash of your password is "ufUniqID" Anyone with a password cracker will be able to convert that back into a usable password to login with.
Thanks
Robert
PS. I would make sure you reset your password after this since anyone reading this will now be able to login to your site as that user.
Comment #9
roball commentedNo, [ufUniqID] is one of the elements of the [CiviCRM] array, besides [ufID], [userID] and [lcMessages]. Its value is empty. This array is stored for all users in the sessions table, including the superadmin (uid=1). So it has nothing to do with the "clear text password" the ldapauth module is supposed to store somewhere (but it looks it does not).
Could anyone who is familiar with the ldapauth module please explain what the "Do not store users' passwords during sessions" option is really doing?
Comment #10
roball commentedrmiddle wrote:
Come on, even if that would be a hashed password (which it isn't for 100%), nobody could login. I haven't posted neither the username nor the URL. Nonsense.
Comment #11
miglius commentedI would suggest clearing the sessions table first and then logging as the ldap user. Maybe you were looking not at the latest entry for your user.
Once you done that you should see a string similar to "ldap_login|a:2:{s:2:"dn";s:32:"uid=a.a,ou=drupal6.debian,dc=mac";s:4:"pass";s:2:"zz";}" in a session column. This is a serialized array 'ldap_login' => array('dn' => 'uid=a.a,ou=drupal6.debian,dc=mac', 'pass' => 'zz'), where zz is a clear text password.
Comment #12
roball commentedThank you Miglius for your useful reply! As you suggested, I completely truncated the sessions table first and then logged in as the LDAP user. After reloading the table, one row came up, so it's belonging to that user for sure. However, still no "ldap_login|a:" entry in the session field.
Looking into the code of "ldapauth.module", I found that the version I am using (6.x-1.0-alpha2, containing CVS version 1.32.2.11) does not contain
as the latest available development snapshot (CVS version 1.32.2.19) does. After upgrading the LDAP integration module to that version, it finally worked as expected :-)
Comment #13
roball commented