Message Boards

LDAP configuration in liferay

avasek atok, modified 9 Years ago.

LDAP configuration in liferay

Junior Member Posts: 41 Join Date: 1/9/15 Recent Posts
Hi - I am fine tuning LDAP configuration parameters in liferay, however i came across two settings "ldap.page.size" and "ldap.range.size", Want some light on the purpose of these fields. Have gone through liferay documentation however i couldn't get much light.

Some body please give some clear explanation on usage of these fields
thumbnail
Andew Jardine, modified 9 Years ago.

RE: LDAP configuration in liferay

Liferay Legend Posts: 2416 Join Date: 12/22/10 Recent Posts
Hi Avasek,

The best documentation is always the source code. I just did a search through thep portal source for LDAP_PAGE_SIZE (the liferay convention is that properties are converted to all capital letters and the dots are replaced with underscores) and found it in the PortalLDAPUtil#searchLDAP method. It looks like it sets the size of the search results page.

LDAP_RANGE_SIZE is in the same file and appear to do something similar --


start += PropsValues.LDAP_RANGE_SIZE;
end += PropsValues.LDAP_RANGE_SIZE;


The LDAP_RANGE_SIZE is in a private method that is called from PortalLDAPUtil#getMultivaluedAttribute -- so perhaps the range has to do with the size of the attributes , while the other is the number of LDAP records to be retrieved in a search result?

The PortalLDAPUtil class is an internal (portalImpl.jar) class so you probably aren't going to be using it directly.
avasek atok, modified 9 Years ago.

RE: LDAP configuration in liferay

Junior Member Posts: 41 Join Date: 1/9/15 Recent Posts
ldap.range.size = 1000 as per the liferay documentation, however in the control panel, I have set only set attributes of a USER like fullName, screenName,...etc.
Does the UI settings will override the range.size parameter.

In my case does ldap.range.size in portal-ext.properties will not have any impact. Please suggest
Franck Liénard, modified 9 Years ago.

RE: LDAP configuration in liferay

New Member Posts: 5 Join Date: 2/13/11 Recent Posts
ldap.page.size sets the page size for directories that support paging such as Microsoft AD.
ldap.range.size sets the number of values to return in each query to a multi-valued attribute for directory servers that support range retrieval.
They are useless if your directory doesn't support these features.
avasek atok, modified 9 Years ago.

RE: LDAP configuration in liferay

Junior Member Posts: 41 Join Date: 1/9/15 Recent Posts
Thanks for responding, but my questions is different. Can you check my question once and help me to understand better.
Franck Liénard, modified 9 Years ago.

RE: LDAP configuration in liferay

New Member Posts: 5 Join Date: 2/13/11 Recent Posts
OK, I checked. Now can you formulate your question so it's understandable? emoticon
thumbnail
Andew Jardine, modified 9 Years ago.

RE: LDAP configuration in liferay

Liferay Legend Posts: 2416 Join Date: 12/22/10 Recent Posts
Avasek,

From my experience as soon as you set something in the control panel, the stuff in the portal-ext.properties file is overlooked -- including properties that you can specify in the file that are NOT in the control panel. I remember digging into the PrefsPropsUtil class once because of this beahaviour. If memory serves, I found that it would check the database and if not found it would return a default value rather than check the portal-ext settings. You can try omitting using the control panel in order to force the portal-ext file to be referenced, but since these are settings that are technically "company" specific Liferay actually recommends (in the source comments) that you use the control panel.

You could probably try using a JSP hook to add the values to the control panel and then save them as part of the portal preferences. You can see the values that are set in the PortalPreferences table where the ownerId matches your companyId (which you can get, if you don't already have it, from the VirtualHost table based on your hostname value).
thumbnail
Jack Bakker, modified 8 Years ago.

RE: LDAP configuration in liferay

Liferay Master Posts: 978 Join Date: 1/3/10 Recent Posts
as Andrew writes : check table portalpreferences for what liferay chooses as authoritative (over and above portal-ext.properties and control panel views)
avasek atok, modified 8 Years ago.

RE: LDAP configuration in liferay

Junior Member Posts: 41 Join Date: 1/9/15 Recent Posts
Thanks Jack and Andew for your suggestions. I actually ran into a situation to fine tune LDAP importer range size.

Currently i have the below setting in portal-ext.properties
ldap.range.size=1000

The above property is to govern the number of attributes that are pulled from the LDAP by LDAPImporter.

In the control panel --> PortalSettings --> Authentication --> LDAP Settings --> UserMapping, I defined attributes (refer to attachment)
Over all i have 8 user attributes there in the UI, but however i am setting the ldap.range.size as 1000 in portal-ext.properties
So now if i run ldap importer only those 8 attributes under UserMapping are imported or since my range.size is 1000 all the user attributes in the central LDAP will be imported.

Hope i am clear now with my question. Please suggest.
thumbnail
Andew Jardine, modified 8 Years ago.

RE: LDAP configuration in liferay

Liferay Legend Posts: 2416 Join Date: 12/22/10 Recent Posts
Hi Avasek,

Ok, if I understand correctly you would like to change the defaul value from 1000 to something else. As far as I know, you cannot control the 1000 value from the control panel and as soon as you set a value in the control panel everything in the portal-ext will be ignored. This means, because you have set the mappings in the control panel, no matter what you place in the portal-ext.properties will never be used -- and the default (portal.properties) value of 1000 will always be used.

If you want to override this value you have two options (I think).

1. As previously mentioned, you could JSP hook the LDAP settings JSP and add additional fields to be saved. These settings are saved in the PortalPreferences table in a XML string which you will find for your instance filtering the query where ownerId = <your companyId>

2. Do ALL your configuration in the portal-ext -- not just LDAP, but other "portal settings" as well. You need to start however by finding the record that is in the portal preferences table for you company and deleting it. Then place all your settings (including the mappings) in the portal-ext and restart the server. If you go this route then I would still suggest a JSP hook that can be used to disable the Portal Settings link so that you cannot make changes via control panel because if you do then you will end up in the same scenario -- portal preferences, even defaults, overriding the settings in the portal-ext.

Hope this helps.