I have successfully configured ldap auth so I can login using active directory but I'm unable to pull the ldap displayName into a profile_full_name field on Drupal. Can I get some pointers on how this is done? I saw several posts about it but I didn't get the gist of how it was done. Thanks in advance.

Comments

miglius’s picture

You need to enable and configure ldapdata module. The data for a user will be pulled on the first login of that user to drupal.

mullman’s picture

I have that setup and it isn't working. I'm using "Same, but read-only mode" and then mapping profile_full_name to displayName. When I log in with my active directory credentials and click My Account I find that the full name field is not populated. Did I miss something else? Thanks for the quick reply.

astreib’s picture

I have been experimenting with the ldap_integration modules and had a similar problem. My account was originally using drupal authentication, and I was able to switch to ldap authentication successfully and had the conflict setting to associate my drupal account with the ldap DN. That all worked fine but I could not get my directory attributes mapped to drupal profile: it would always show the druapl values.

So I dug through the code and found that the profile/attribute sync only happens if user_get_authmaps() indicates that the user was authenticated by ldapauth.

This should be, I thought... I dug into the ldapauth code and found that everything looked like it should be setting ldapauth as the authmap value. user_save() is called, and in the core users.module it will try to update the authmap table. However in my case I already had an entry in that table for 'webserver_auth', and it will not replace this with 'ldapauth', it just silently fails on a unique constraint violation on authname.

So, the quick fix is to go into mysql, delete from authmap where authname = 'my-login-name', logout and log in again, after that the profile/attribute sync works.

I think this might be a bug in the drupal core; I'm going to report it and see where it goes.

astreib’s picture

My report and the reply(s) are here: http://drupal.org/node/905498

verta’s picture

From the reply

"The general way of doing this is to postfix the authname with @ldap"

- if there is a patch available, I can test it.

cgmonroe’s picture

Clearing out old support requests... but I did try to duplicate this with the latest dev and couldn't. If this problem still exists please re-open.

cgmonroe’s picture

Status: Active » Closed (fixed)