LDAP Attribute Mapping

Last updated on
16 October 2025

Attribute Mapping allows mapping user's information from LDAP Server to user attributes in Drupal. It allows you to map various user information coming from your LDAP server to your user attributes in Drupal. like Email Attribute, Username,  any custom attributes, etc. The module is compatible with Drupal 8, Drupal 9, Drupal 10 as well as Drupal 11.

Download       Know more   Free Trial

Prerequisites:

Basic Attribute Mapping :

  • Basic attribute mapping allows you to map the email and the username attributes present in Drupal with the user information stored in your LDAP server :

  • Please note: Mapping the Email attribute is mandatory for LDAP Login to work.

    Drupal-LDAP-click-on-the-Attribute-Role-Mappings-tab

  • After successfully configuring the module head towards the Attribute & Role Mapping tab (admin/config/people/ldap_auth/attribute_mapping) of the module.
  • Under the Email Attribute select the LDAP attribute name that contains your user's email address from the dropdown.

    Drupal-LDAP-select-the-email-attribute

Custom Attribute Mapping :

Custom attribute mapping helps you map all user fields (existing or custom fields) in Drupal with the user information from your LDAP server. To do this, follow the below steps:

  • Choose the LDAP Attribute Name form the dropdown and select the corresponding Drupal Field Machine Name which you want to map.

  • Click on the Add row button if you want to perform more than one mapping. And then click on the Save Attribute Mapping button to save your changes.

    Drupal-LDAP-perform-custom-attribute-mapping

Creating Drupal Attribute Machine Name :

  • Navigate to the Configuration tab, Under the People section, select Account Settings.  (admin/config/people/accounts)

    Drupal-click-on-the-configuration-tab

  • Go to the Manage fields Tab and click  + Create a new field button.

    Drupal-manage-field-and-create-field

  • In the Add field section, select the field type. 
  • Click on the Continue button.

    Drupal-add-field-and-label

  • In the next window, enter the label into the Label ​​​​​​textfield and select Text (plain).
  • Click on the Continue button.

    Drupal-save-created-field

  • In the settings, scroll down and click on the Save settings button.

    Drupal-ldap-save-the-created-field.png

  • You can use the Machine name generated here, in the Drupal attribute Machine name at the time of custom attribute mapping.

    Drupal-field-is-successfully-created

Now, let’s see how LDAP attribute mapping works:

  • Open a private window or a new browser and visit the Drupal site's login page (/user/login).
  • Log in using your LDAP credentials.
  • After a successful login:
    • Your Drupal username will be mapped with your LDAP given name.
    • Your last_name in Drupal will be mapped with your LDAP common name (cn).

Check Mapped Attributes:

  • Navigate to the People tab.
  • Under the List section, click on the Edit button.
  • Scroll down to see the Drupal custom fields with the mapped LDAP attribute value.

    Drupal-ldap-attributes-mapped-successfully

Contact our 24*7 support team

Feel free to reach out to our Drupal experts if you need any sort of assistance in setting up the LDAP / Active Directory Integration module on your Drupal site.

Get In Touch With Us    Join Our Slack Channel

back to top Back to top

Help improve this page

Page status: No known problems

You can: