Server Name: anything that your choice.
Server Types:  This server you have used like Apache AD, Microsoft AD or OpenLDA.
Base Provider URL: this is LDAP URL to connect your server. General port number for LDAP is 389.
Base DN: This specify that where exactly your user nodes available

meera.com  is my company
I have organization units Finance, IT
In organization I have users
Then Base DN likes: CN=users,OU=finance,DC=meera,DC=com
If I have two users in names are Peter in finance and Tom in IT
Then exact user Node like this

CN=Tom ,CN=users,OU=IT,DC=meera,DC=com

The following are the base DN for above server

CN=users,OU=finance,DC=meera,DC=com  : find users in meera company finance organization
CN=users,OU=IT,DC=meera,DC=com      : find users in meera company IT organization

OU=IT,DC=meera,DC=com  : find users and others type objects in meera company in IT organization

OU=finance,DC=meera,DC=com  : find users and others type objects in meera company in finance  organization

DC=meera,DC=com  : find users and other objects /nodes in meera company in both organizations IT and finance

Above all we can specify as base DN based on your requirement

Principle: this is like user name to connect to your LDAP server means admin username

Credentials: this is password means admin password of LDAP

Once you complete all above then click on test server button and see the result you will get following pop up Now we successfully connected to LDAP server

Configure Authentication Filter and Import Filter Now go to user section in same screen you can find following screen

You can find first text box is Authentication Search Filter
Note:  Here authentication filters and import filter is very important.
Authentication Filter: This means in which base user will be searched in ldap when user trying login in  life ray means when we use liferay authentication by emailAddreess  then we need to map liferay email address with appropriate attribute in ldap
When its by screen name
Then we need to map liferay screen name with appropriate attribute in LDAP

Note here whatever attribute you are going to use then value of attribute should not be duplicate.
Import filter: This is used to search users from ldap based on filter and all matched results will be imported into
Liferay User_ table
Here we need to consider one thing whatever the import filter used  that results should have  email address related ldap attribute  and screen name mapping ldap attribute otherwise we will get more exceptions.
Here generally we import mostly users means in ldap is  objectClass=person.
We can also narrow the filter by using ldap filters more details how to pass ldap filter go through following link

Note: Some times in ldap all nodes may not be persons and if persons them may not have email address related attributes or screen name attribute in ldap then we get more import problems
So here we need to give proper import filter so that all nodes have mail related attribute or screen name related attributes
Generally the life ray screen name equal attribute cn or sAMAccountName
Similarly liferay email address equal attribute in ldap is userPrincipalName or mail
These attributes should be present in each object class=person node otherwise import issues we can expect.
Example import filer

(objectClass=person) means it will search all ldap nodes that would be object class is person nothing but user. Some time object class may be organizationUser too.
Another Example Filter:

& is operator like and operator in java similarly | is like || operator in java
The above meaning is the node is person and he is belongs to any one of the department.

Import mappings

Import mapping used when user is import from ldap to liferay User_ table.
Here we are mapping required attribute for liferay from ldap.
In ldap has many attribute for user or objectClass=person.
So we map each appropriate ldap attribute with liferay attributes Now we successfully created LDAP server and we also specify the user mappings to import users into liferay

Now we need set some configuration so that when user should be import what are the password policies we need when create password.
The following screen show that configurations This is starting point to LDAP integration when we enable then only LDAP is integrated to Liferay so we should enable when you want integrate ldap with liferay.
When we enable LDap when the user going to authenticate   will search in LDAP tree  if user find then it will set ladapAuthentication true and user will be imported.
This for every user when they login first time or first attempt then user will be imported.

Make exceptions for omni  admins so that if they break the LDAP configuration, they can still login to fix the problem
Import Enable:

When we enable this all LDAP user will be imported into liferay User_ table and related entries in other tables like Group_
Import on Startup Enabled:

when we enable this all users will be imported at the time of liferay server starts.
Once user is imported then one entry is created in LOCK_ table. This specifies that for what intervals import should be happened. This property we can set in portal properties Use LDAP Password Policy:
When enable Use LDAP Password Policy option in configuration then when login it won’t  ask  change new password. Only ask terms and conditions otherwise it will ask change to new password when user is attempt first login.

Important Observations:

Reason when the user import it is based on liferay user attributes mapping to ldap attribute user will be created.

Generally  cn or sAMsaccount as screen name.
When user imported cn will become as screen name in User_ table. And one more entry is created in group_ table the friendly url same as screen name means /the secreen name or  /cn
When this Friedly URL is duplicate in Group table then you can see GroupFriendlyException   when you get these exceptions the user won’t be imported.

So here we need to very much care full screen name should not be duplicate mean in ldap there are thousands of users, we need to identify attribute value in ldap that should not be duplicate.
If the ldap some thing duplicate mean cn or saMsAccount then should not use these attribute as screen name.
One more thing when we enable import enables then all users will automatically import into User_ table based on configuration.

So here thing is when we enable import enable option in configuration means all ldap users will be imported into liferay.

If we not enable import enable then each user their first login will be imported.

Import on start up means when server start then all user will be imported automatically. The entry will be created in LOCK_ table there you can see expiration Date column. One expiration date less than current date then again import will be start until import won’t be activated.

We can choose authentication either by email Address or by screen name

If we choose any one email mapping in ldap attribute and screen name mapping in ldap should not be duplicate if such case we get

UserScreenNameException  or UserEmail Address exceptions
When we use authentication by email address as our authentication type its better we can make auto generated  screen name then it won’t be any problem when all users is importing. But email should be unique. When we use screen name it should not be numbers in start of screen name. If such case please set portal property users.screen.name.allow.numeric=true.

You can also change screen name valuator according to your choice by following property.

Input a class names that implements com.liferay.portal.security.auth.ScreenNameValidator. This class will be called to validate user screen names

Input a class names that implements com.liferay.portal.security.auth.ScreenNameGenerator. This class will be called to generate user screen names.

Email address should not be starting with number such case you will get UsereEmaillAddress exception.
You can change userEmaildAddressPolicies you can also skip email address when user in imported by following property.

Related Properties:

Set this to false if you want to be able to create users without an email address. An email address will be automatically assigned to a user based on the property "users.email.address.auto.suffix".

Set the suffix of the email address that will be automatically generated for a user that does not have an email address. This property is not used unless the property "users.email.address.required" is set to false. The auto generated email address will be the user id plus the specified suffix.

Input a class names that implementscom.liferay.portal.security.auth.EmailAddressGenerator. This class will be called to generate an email address for a user that does not specify anemail address. This class will only be used if the propertyusers.email.address.required" is set to false.

Input a class names that implementscom.liferay.portal.security.auth.EmailAddressValidator. This class will be called to validate user email addresses

Input a class names that implementscom.liferay.portal.security.auth.FullNameGenerator. This class will be called to generate a full name from the user's first, middle and last names

Input a class names that implements com.liferay.portal.security.auth.FullNameValidator. This class will be called to validate user first, middle and last names.

Important LDAP Properties In liferay:

Set the values used to connect to a LDAP store means LDAP implementation class

Set the page size for directory servers that support paging. This value needs to be 1000 or less for Microsoft Active Directory Server.
If you want more search results for Microsoft AD server then AD server admin can configure this number in AD configuration. Please contac admin to set this value from AD server configurations.

Set the number of values to return in each query to a multivaluedattribute for directory servers that support range retrieval. The range size must be 1000 or less for Windows 2000 and 1500 or less for Windows Server 2003.
ldap.auth.method=bind  / dap.auth.method=password-compare

Set either bind or password-compare for the LDAP authentication method. Bind is preferred by most vendors so that you don't have to worry about encryption strategies.
LDAP Password Import Algorithm:

Set the password encryption to use for comparing passwords during import and to use for encrypting passwords during export. Comparing password during import will only be used when the property "ldap.auth.method" is set to password-compare. If the encryption is set to NONE, which is the default value, passwords are considered as plain text. The SHA-51  algorithm is currently unsupported.

You can write your own class that implements com.liferay.portal.security.ldap.AttributesTransformer to transform the LDAP attributes before a user or group is imported to the LDAP store.
LDAP Connection Properties:

Specify the settings for LDAP connections. Any property prefixed with "ldap.connection." will be passed to the LDAP context as an environment variable. See the following link:

ldap.import.method=user or ldap.import.method=group

We have choose any one of two
Set either user or group for import method. If set to user, the portal will import all users and the groups associated with those users. If set to group, the portal import all groups and the users associated thosegroups. This value should be set based on how your LDAP server stores group membership information.

Set the lock expiration time for LDAP import. By default, the expiration time is 1 day.

If set to true, the group filter will be applied, but only to groups in the specified base DN. If set to false, the filter will not be applied and all groups that are associated with the imported users will be imported regardless of the base DN.

Specify whether group DN lookups will be cached during LDAP import and login. If set to true, this will speed up LDAP import and login, but updates to group attributes will not be recognized until the cache entry expires. The cache size and timeout may be configured in the configuration file specified in the property "ehcache.single.vm.config.location".

Set this to true if the portal should automatically create a role per  group imported from LDAP. The role will be assigned to the group so that users can automatically inherit that role when they are assigned to the group.

Set these following values to be a portion of the error message returned by the appropriate directory server to allow the portal to recognize messages from the LDAP server. The default values will work for Fedora DS.
ldap.error.password.not.changeable=not allowed to change
ldap.error.user.lockout=retry limit

Set this to false when the LDAP user's password should not be imported.

Set this to true to auto generate the password for imported users from LDAP This property is only in use if the property "ldap.import.user.password.enabled" is set to false.

Set either screenName or plain text as the default password for the  imported LDAP user. Setting the value to screenName will use the user's screen name as the password for the imported LDAP user. Setting the value to any other plain text value will use that value as the password for the  imported LDAP user. This property is only in use if the properties "ldap.import.user.password.enabled" and "ldap.import.user.password.autogenerated" are both set to false.

Set the user attributes that are controlled from the portal. When adding or updating a user from LDAP, these attributes will be skipped.
[null, {"document_url": "http://www.liferaysavvy.com/2013/10/liferay-ldap-integration_8.html", "unformatted_src": "http://2.bp.blogspot.com/-x4tco6knGHE/UlOnZ706_tI/AAAAAAAAEgY/qFuk0aIt7_g/s1600/ldap1.PNG", "src": "http://2.bp.blogspot.com/-x4tco6knGHE/UlOnZ706_tI/AAAAAAAAEgY/qFuk0aIt7_g/s1600/ldap1.PNG", "formatted_filename": "ldap", "rendered_width": 400, "rendered_height": 215}, null, {"document_url": "http://www.liferaysavvy.com/2013/10/liferay-ldap-integration_8.html", "unformatted_src": "http://4.bp.blogspot.com/-kZAnUgkzCas/UlOnbD_ErkI/AAAAAAAAEg0/-24veBPHXxE/s1600/ldap2.PNG", "src": "http://4.bp.blogspot.com/-kZAnUgkzCas/UlOnbD_ErkI/AAAAAAAAEg0/-24veBPHXxE/s1600/ldap2.PNG", "formatted_filename": "ldap", "rendered_width": 400, "rendered_height": 215}, null, {"document_url": "http://www.liferaysavvy.com/2013/10/liferay-ldap-integration_8.html", "unformatted_src": "http://4.bp.blogspot.com/-7XSCSweB7iU/UlOnbldqdkI/AAAAAAAAEg8/Mcs5fWvjZTg/s1600/ldap3.PNG", "src": "http://4.bp.blogspot.com/-7XSCSweB7iU/UlOnbldqdkI/AAAAAAAAEg8/Mcs5fWvjZTg/s1600/ldap3.PNG", "formatted_filename": "ldap", "rendered_width": 400, "rendered_height": 217}, null, {"document_url": "http://www.liferaysavvy.com/2013/10/liferay-ldap-integration_8.html", "unformatted_src": "http://4.bp.blogspot.com/-9eD7trFoUYU/UlOnb2SnpXI/AAAAAAAAEhE/UTwOeDn2fSo/s1600/ldap4.PNG", "src": "http://4.bp.blogspot.com/-9eD7trFoUYU/UlOnb2SnpXI/AAAAAAAAEhE/UTwOeDn2fSo/s1600/ldap4.PNG", "formatted_filename": "ldap", "rendered_width": 400, "rendered_height": 273}, null, {"document_url": "http://www.liferaysavvy.com/2013/10/liferay-ldap-integration_8.html", "unformatted_src": "http://1.bp.blogspot.com/-sRQuVvjduBQ/UlOrKjuyKPI/AAAAAAAAEj8/ld3rXNqcCMU/s1600/ldap7.png", "src": "http://1.bp.blogspot.com/-sRQuVvjduBQ/UlOrKjuyKPI/AAAAAAAAEj8/ld3rXNqcCMU/s1600/ldap7.png", "formatted_filename": "ldap", "rendered_width": 400, "rendered_height": 47}, null, {"document_url": "http://www.liferaysavvy.com/2013/10/liferay-ldap-integration_8.html", "unformatted_src": "http://3.bp.blogspot.com/-6pbH_xA8omA/UlOrZl6B5EI/AAAAAAAAEkE/3uItqeCgu28/s1600/ldap8.png", "src": "http://3.bp.blogspot.com/-6pbH_xA8omA/UlOrZl6B5EI/AAAAAAAAEkE/3uItqeCgu28/s1600/ldap8.png", "formatted_filename": "ldap", "rendered_width": 400, "rendered_height": 46}, null, {"document_url": "http://www.liferaysavvy.com/2013/10/liferay-ldap-integration_8.html", "unformatted_src": "http://4.bp.blogspot.com/-uvMvLO6OkZo/UlOpl8fY8XI/AAAAAAAAEjY/3c-A33J9_B0/s1600/ldap4.PNG", "src": "http://4.bp.blogspot.com/-uvMvLO6OkZo/UlOpl8fY8XI/AAAAAAAAEjY/3c-A33J9_B0/s1600/ldap4.PNG", "formatted_filename": "ldap", "rendered_width": 400, "rendered_height": 273}, null, {"document_url": "http://www.liferaysavvy.com/2013/10/liferay-ldap-integration_8.html", "unformatted_src": "http://2.bp.blogspot.com/-6lPtsaZRwsA/UlOpjmDn2ZI/AAAAAAAAEig/vFTaW1Vso9w/s1600/ldap1.PNG", "src": "http://2.bp.blogspot.com/-6lPtsaZRwsA/UlOpjmDn2ZI/AAAAAAAAEig/vFTaW1Vso9w/s1600/ldap1.PNG", "formatted_filename": "ldap", "rendered_width": 400, "rendered_height": 215}, null, {"document_url": "http://www.liferaysavvy.com/2013/10/liferay-ldap-integration_8.html", "unformatted_src": "http://1.bp.blogspot.com/-MPXTCtZZXCc/UlOr8GZpG6I/AAAAAAAAEkQ/_RfNGXKwhLE/s1600/lock.PNG", "src": "http://1.bp.blogspot.com/-MPXTCtZZXCc/UlOr8GZpG6I/AAAAAAAAEkQ/_RfNGXKwhLE/s1600/lock.PNG", "formatted_filename": "lock", "rendered_width": 400, "rendered_height": 208}, null, {"document_url": "http://www.liferaysavvy.com/2013/10/liferay-ldap-integration_8.html", "unformatted_src": "http://1.bp.blogspot.com/-272IxMuer2c/UlOsQbeN6TI/AAAAAAAAEkY/yFQ7qm9UnDU/s1600/ldap10.png", "src": "http://1.bp.blogspot.com/-272IxMuer2c/UlOsQbeN6TI/AAAAAAAAEkY/yFQ7qm9UnDU/s1600/ldap10.png", "formatted_filename": "ldap", "rendered_width": 400, "rendered_height": 178}, null, {"document_url": "http://www.liferaysavvy.com/2013/10/liferay-ldap-integration_8.html", "unformatted_src": "http://2.bp.blogspot.com/-E2zeDk3O0s0/UlOtKS8-LFI/AAAAAAAAEk0/3p3bAF0eZ9s/s1600/ldap11.png", "src": "http://2.bp.blogspot.com/-E2zeDk3O0s0/UlOtKS8-LFI/AAAAAAAAEk0/3p3bAF0eZ9s/s1600/ldap11.png", "formatted_filename": "ldap", "rendered_width": 400, "rendered_height": 190}, {"document_url": "http://www.liferaysavvy.com/2013/10/liferay-ldap-integration_8.html", "unformatted_src": "http://1.bp.blogspot.com/-MHsW9kRsN90/UlOte48BGCI/AAAAAAAAEk8/EG5PzoSgqbY/s1600/ldap12.png", "src": "http://1.bp.blogspot.com/-MHsW9kRsN90/UlOte48BGCI/AAAAAAAAEk8/EG5PzoSgqbY/s1600/ldap12.png", "formatted_filename": "ldap", "rendered_width": 400, "rendered_height": 253}, {"document_url": "http://www.liferaysavvy.com/2013/10/liferay-ldap-integration_8.html", "unformatted_src": "http://3.bp.blogspot.com/-xhN-joD-G3o/UlOttO60DhI/AAAAAAAAElE/T2HVTvmP0JM/s1600/ldap13.png", "src": "http://3.bp.blogspot.com/-xhN-joD-G3o/UlOttO60DhI/AAAAAAAAElE/T2HVTvmP0JM/s1600/ldap13.png", "formatted_filename": "ldap", "rendered_width": 400, "rendered_height": 267}, null, null, null, null, null, {"document_url": "http://www.liferaysavvy.com/2013/10/liferay-ldap-integration_8.html", "unformatted_src": "//lh4.googleusercontent.com/-q06zTooeh10/AAAAAAAAAAI/AAAAAAAAN04/V7gdj1l-cUg/s80-c/photo.jpg", "src": "http://lh4.googleusercontent.com/-q06zTooeh10/AAAAAAAAAAI/AAAAAAAAN04/V7gdj1l-cUg/s80-c/photo.jpg", "formatted_filename": "photo", "alt_text": "My Photo", "rendered_width": 80, "rendered_height": 80}, null, null, null, null, null, null, null, null, null, null, null, null, null]