Use attributes from LDAP repository as input to Groovy repository

29 views
Skip to first unread message

Jonathon Taylor

unread,
Nov 22, 2022, 11:56:32 PM11/22/22
to CAS Community
Hello,

I am trying to find a way to use attributes resolved by an LDAP repository and pass them through to a Groovy repository in order to calculate/derive additional attributes.  Does anyone know if this is possible?  We are running CAS 6.5.8.

# LDAP repo
cas.authn.attribute-repository.ldap[0].order=0
cas.authn.attribute-repository.ldap[0].attributes.uid=uid
etc...

# Groovy repo
cas.authn.attribute-repository.groovy[0].order=1
cas.authn.attribute-repository.groovy[0].location=file:/etc/cas/config/groovy_scripts/attributes.groovy
cas.authn.attribute-repository.core.merger=ADD

Here is what the Groovy script gets as input:

2022-11-22 13:46:27,129 TRACE [org.apereo.cas.util.scripting.ScriptingUtils] - <Creating groovy object instance from class [/etc/cas/config/groovy_scripts/attributes.groovy]>
2022-11-22 13:46:27,145 TRACE [org.apereo.cas.util.scripting.ScriptingUtils] - <Executing groovy script's [run] method, with parameters [[jonathont, {principal=[jonathont], credentialClass=[UsernamePasswordCredential], credentialId=[jonathont], username=[jonathont]}, org.apache.logging.slf4j.Log4jLogger@650c2f75, org.apereo.cas.configuration.CasConfigurationPr
operties@31354e86, org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@2dc6350c, started on Tue Nov 22 13:46:02 PST 2022, parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@23a01439]]>

Thanks!
Reply all
Reply to author
Forward
0 new messages