uPortal-Project / uPortal

Enterprise open source portal built by and for the higher education community.
https://www.apereo.org/projects/uportal
Apache License 2.0
270 stars 273 forks source link

SmartLdapGroupStore ContextMapper feature can't be null in the init.crn #2141

Closed jgribonvald closed 3 years ago

jgribonvald commented 4 years ago

Describe the bug Staying on the attributeMapper inside the SamrpLDAPGroupStore configuration isn't anymore available due to #1989 In the init.crn the ldap-search require that the contextMapper is not null ! and from the groupStore class we can't have the atrributeMapper defined at the same time than the contextMapper.

To Reproduce Steps to reproduce the behavior:

  1. configure the SamrLdapGroupStrore with the attributemapper only.
  2. deploy and restart the tomcat
  3. connect to uPortal and watch logs - users can't connect

Expected behavior Cernunnos lib seems buggy and should manage correctly things !

Stacktrace

ERROR [SmartLdap Refresh Worker] o.a.p.g.s.SmartLdapGroupStore 2020-08-18 11:15:54,835 - SmartLdapGroupStore failed to build the groups tree org.danann.cernunnos.ManagedException: The Cernunnos Runtime encountered an error: Origin Document: file:/opt/webapps/uPortal/WEB-INF/classes/org/apereo/portal/groups/smartldap/init.crn Source: /with-attribute/ldap-search/@context-mapper Entity Name: ${org.danann.cernunnos.AttributePhrase} at org.danann.cernunnos.runtime.RuntimePhraseDecorator.evaluate(RuntimePhraseDecorator.java:91) at org.danann.cernunnos.runtime.ConcatenatingPhrase.evaluate(ConcatenatingPhrase.java:77) at org.danann.cernunnos.runtime.RuntimeReagentDecorator.evaluate(RuntimeReagentDecorator.java:71) at org.danann.cernunnos.ldap.SearchTask.perform(SearchTask.java:203) at org.danann.cernunnos.runtime.RuntimeTaskDecorator.perform(RuntimeTaskDecorator.java:77) at org.danann.cernunnos.AbstractContainerTask.performSubtasks(AbstractContainerTask.java:148) at org.danann.cernunnos.AbstractContainerTask.performSubtasks(AbstractContainerTask.java:123) at org.danann.cernunnos.core.SetAttributeTask.perform(SetAttributeTask.java:66) at org.danann.cernunnos.runtime.RuntimeTaskDecorator.perform(RuntimeTaskDecorator.java:77) at org.danann.cernunnos.runtime.ScriptRunner$TaskDecorator.perform(ScriptRunner.java:436) at org.danann.cernunnos.runtime.ScriptRunner.run(ScriptRunner.java:288) at org.danann.cernunnos.runtime.ScriptRunner.run(ScriptRunner.java:225) at org.apereo.portal.groups.smartldap.SmartLdapGroupStore.buildGroupsTree(SmartLdapGroupStore.java:731) at org.apereo.portal.groups.smartldap.SmartLdapGroupStore.access$200(SmartLdapGroupStore.java:57) at org.apereo.portal.groups.smartldap.SmartLdapGroupStore$2.run(SmartLdapGroupStore.java:645) Caused by: java.lang.IllegalArgumentException: The specified attribute is not defined: contextMapper

Platform:

Additional things It may be great to watch on moving from cernnunos which is old and not really used now to a groovy script, what do you think ?

ChristianMurphy commented 4 years ago

It may be great to watch on moving from cernnunos which is old and not really used now to a groovy script, what do you think ?

I agree, much of the functionality from cernnunos has been superseded by Spring framework.

bjagg commented 3 years ago

I think the mapperType should be attribute rather than attributes at https://github.com/Jasig/uPortal/blob/7e8dddaa5be0468fcc5c1d6eb443b44f12ae4d4a/uPortal-groups/uPortal-groups-smartldap/src/main/java/org/apereo/portal/groups/smartldap/SmartLdapGroupStore.java#L721

bjagg commented 3 years ago

I'll be looking at this soon. @jgribonvald do you have a work-around?

jgribonvald commented 3 years ago

good question for the mapperType, I didn't seen it !

My work around is in deploying the previous init.crn file with uPortal-start (by override) and keep the attributeMapper conf ;)

cbeach47 commented 3 years ago

The fix for this has been merged into master.