Fórumok

Liferay 6.1 integrate with two ADs through portal-ext.properties

Abhi R, módosítva 9 év-val korábban

Liferay 6.1 integrate with two ADs through portal-ext.properties

New Member Bejegyzések: 20 Csatlakozás dátuma: 2013.12.18. Legújabb bejegyzések
Hi guys,

I'm trying to integrate my Liferay Environment with two ADs and want to do that through portal-ext.properties. I am successfully able to do it for one AD but when I add details of two ADs I get a null pointer exception in UnsyncStringReader.
02:46:22,648 ERROR [liferay/scheduler_dispatch-2][PortalLDAPImporterImpl:205] Error importing LDAP users and groups
java.lang.NullPointerException
at com.liferay.portal.kernel.io.unsync.UnsyncStringReader.<init>(UnsyncStringReader.java:34)
at com.liferay.portal.kernel.util.PropertiesUtil.load(PropertiesUtil.java:208)
at com.liferay.portal.kernel.util.PropertiesUtil.load(PropertiesUtil.java:201)
at com.liferay.portal.security.ldap.LDAPSettingsUtil.getGroupMappings(LDAPSettingsUtil.java:102)
at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importFromLDAP(PortalLDAPImporterImpl.java:185)
at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importFromLDAP(PortalLDAPImporterImpl.java:149)
at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importFromLDAP(PortalLDAPImporterImpl.java:95)
at com.liferay.portal.security.ldap.PortalLDAPImporterUtil.importFromLDAP(PortalLDAPImporterUtil.java:39)
at com.liferay.portlet.admin.messaging.LDAPImportMessageListener.doReceive(LDAPImportMessageListener.java:28)
at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:25)
at sun.reflect.GeneratedMethodAccessor215.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:67)
at $Proxy283.receive(Unknown Source)
at com.liferay.portal.kernel.scheduler.messaging.SchedulerEventMessageListenerWrapper.receive(SchedulerEventMessageListenerWrapper.java:73)
at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:63)
at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:114)
at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:671)
at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:582)
at java.lang.Thread.run(Thread.java:619)

My configurations are as follows. I'd appreciate any pointers towards why this null pointer is occurring!

#Common LDAP Properties.
ldap.auth.enabled=true
ldap.export.enabled=true
ldap.auth.required=true
ldap.import.enabled=true
ldap.import.on.startup=true
ldap.server.ids=0,1

#LDAP Server 1 Settings
ldap.server.name.0=CustomersAD
ldap.base.provider.url.0=ldap://XXXXX.XXXX.XXX
ldap.base.dn.0=OU=XXXX,OU=XXXX,OU=XXX,DC=XX,DC=XX
ldap.security.principal.0=XXXXX\\XXXX
ldap.security.credentials.0=XXXX
ldap.auth.search.filter.0=(mail=@email_address@)
ldap.import.user.search.filter.0=(objectClass=person)
ldap.user.mappings.0=screenName=cn\npassword=userPassword\nemailAddress=mail\nfirstName=givenName\nlastName=sn\nJobTitle=title
ldap.auth.method.0=bind
ldap.users.dn.0=OU=XXXX,OU=XX,OU=XXX,DC=XXXX,DC=XXX
ldap.user.default.object.classes.0=top,person,organizationalPerson,user
ldap.user.custom.mappings.0=
ldap.contact.mappings.0=
ldap.contact.custom.mappings.0=

#LDAP Server 2 Settings
ldap.server.name.1=EmployeeAD
ldap.base.provider.url.1=ldap://XxXXX.XXXX.XXXX
ldap.base.dn.1=OU=XXXXXX,OU=XXXX,OU=XXxx,DC=xxxx,DC=xxxx
ldap.security.principal.1=xxxxx\\xxxxx
ldap.security.credentials.1=xxxx
ldap.auth.search.filter.1=(mail=@email_address@)
ldap.import.user.search.filter.1=(objectClass=person)
ldap.user.mappings.1=screenName=cn\npassword=userPassword\nemailAddress=mail\nfirstName=givenName\nlastName=sn\nJobTitle=title
ldap.auth.method.1=bind
ldap.user.custom.mappings.1=
ldap.contact.mappings.1=
ldap.contact.custom.mappings.1=
thumbnail
Tomas Polesovsky, módosítva 9 év-val korábban

RE: Liferay 6.1 integrate with two ADs through portal-ext.properties

Liferay Master Bejegyzések: 676 Csatlakozás dátuma: 2009.02.13. Legújabb bejegyzések
Abhi R:
Hi guys,

I'm trying to integrate my Liferay Environment with two ADs and want to do that through portal-ext.properties. I am successfully able to do it for one AD but when I add details of two ADs I get a null pointer exception in UnsyncStringReader.
02:46:22,648 ERROR [liferay/scheduler_dispatch-2][PortalLDAPImporterImpl:205] Error importing LDAP users and groups
java.lang.NullPointerException
at com.liferay.portal.kernel.io.unsync.UnsyncStringReader.<init>(UnsyncStringReader.java:34)
at com.liferay.portal.kernel.util.PropertiesUtil.load(PropertiesUtil.java:208)
at com.liferay.portal.kernel.util.PropertiesUtil.load(PropertiesUtil.java:201)
at com.liferay.portal.security.ldap.LDAPSettingsUtil.getGroupMappings(LDAPSettingsUtil.java:102)
...


Hi, looking into code
* https://github.com/liferay/liferay-portal/blob/6.1.1-ga2/portal-service/src/com/liferay/portal/kernel/util/PropertiesUtil.java#L208
* https://github.com/liferay/liferay-portal/blob/6.1.1-ga2/portal-impl/src/com/liferay/portal/security/ldap/LDAPSettingsUtil.java#L102

you need to create also these properties:
ldap.group.mappings.0=
ldap.group.mappings.1=
Abhi R, módosítva 9 év-val korábban

RE: Liferay 6.1 integrate with two ADs through portal-ext.properties

New Member Bejegyzések: 20 Csatlakozás dátuma: 2013.12.18. Legújabb bejegyzések
Hi Tomas,

Thanks for your quick reply.

I don't want to import any groups, just users from specific Organizational Units in from two different ADs?
Do I have to set this property and import Group when I don't need them. Is there a workaround?

Thanks,
Abhi.
thumbnail
Tomas Polesovsky, módosítva 9 év-val korábban

RE: Liferay 6.1 integrate with two ADs through portal-ext.properties

Liferay Master Bejegyzések: 676 Csatlakozás dátuma: 2009.02.13. Legújabb bejegyzések
Hi Abhi,

you need the properties, but they can hold no value.

I didn't try it but try this: ldap.import.group.search.filter.enabled=false

https://github.com/liferay/liferay-portal/blob/6.1.1-ga2/portal-impl/src/com/liferay/portal/security/ldap/PortalLDAPImporterImpl.java#L780,L781