Importing Contact and Custom Field Mappings From LDAP

In some environments it may be desirable to import a user's contact information from an LDAP server. This article explains how to import custom mappings as well as contact mappings from a Microsoft Active Directory LDAP server using the following properties:


**In this article, the properties which end with .0 indicate that they are set for the LDAP server called 0. You can set up several LDAP servers in the portal-ext, and this part indicates which server the properties belong to.

Quick Example:


Please note that in order to use this functionality, the portal must connect to LDAP via the file. Once the connection is made through the Control Panel GUI, the connection values are written to the database which overrides the portal-ext in precedence.


Before starting the Liferay Instance with LDAP:

  1. Include the following LDAP properties in the file:

    (Note that the connection mappings might be different for each setup.)


    The two properties in bold are pointing to the contact and custom field mappings.

  2. Start the portal and log in as the admin user
  3. Go to Control Panel > Authentication > LDAP. Check the Enabled check box and click save.
  4. In the Control Panel > Authentication page, set the drop down menu to allow users to authenticate by screen name.
  5. Navigate to the LDAP server.
  6. Open the directory in a LDAP text editor.
  7. Create a user named TEST_USER. Be sure to give the user all the appropriate information to allow him to be imported:

    First Name, Last Name, Password, Email Address, Screen Name

  8. Open the user's properties and find the field called 'employeeType.' Click edit and set the value to 'Joe Bloggs.' Click Save.
  9. Now, scroll down to the 'telephoneNumber' field. Edit this field and set the value to '5555555555.'
  10. In the Liferay Portal, go to Control Panel > Custom Fields > User > Add New Field. Fill in the name Telephone and make sure Text Box is selected in the drop-down menu.
  11. Click the new field. Adjust the height to 100 and the width to 200 so that the test box will be visible. Click Save.
  12. Now sign out as the admin user and sign in as TEST_USER with the password. The user will be imported. Once he is fully signed in, sign out.
  13. Sign back in as the admin user and go to Control Panel > Users and Organizations. Click on TEST_USER.
  14. Go to the Custom Field tab in the right hand menu towards the bottom. Verify that the telephone number has been imported.
  15. Now, in the right had menu towards the middle, go to the Instant Messenger tab. 'Joe Bloggs' appears in the Skype field.

Additional Information

For a list of contact attributes to use, see com.liferay.portal.model.ContactModel

Note: While this article used the, any LDAP mapping that is empty could be used in place of 'employeeType.'

1 人中有 1 人觉得有帮助