cas 7.1.0 disable slf4j and active groovy for auditing .Is it work ?

74 views
Skip to first unread message

artur mis

unread,
May 14, 2024, 8:10:04 AM5/14/24
to CAS Community
cas.propierties
cas.audit.slf4j.enabled=false
cas.audit.groovy.template.location=file:/etc/cas/GroovyAuditor.groovy



cat GroovyAuditor.groovy
${logger.info("Hello, World")}
who: ${who}, what: ${what}, when: ${when}, ip: ${clientIpAddress}, trace: ${customHttpRequestHeader}


logs:


2024-05-14 12:55:14,429 ERROR [org.apereo.cas.web.support.filters.AbstractSecurityFilter] - <Request processing failed: org.springframework.webflow.execution.ActionExecutionException: Exception thrown executing org.apereo.cas.web.flow.login.InitialAuthenticationRequestValidationAction@1ce6a01e in state 'initialAuthenticationRequestValidationCheck' of flow 'login' -- action execution attributes were 'map[[empty]]'
        FrameworkServlet.java:processRequest:1022
        FrameworkServlet.java:doGet:903
        HttpServlet.java:service:527


       ... 109 more
Caused by: groovy.lang.MissingPropertyException: No such property: customHttpRequestHeader for class: groovy.lang.Binding
        at groovy.lang.Binding.getVariable(Binding.java:61) ~[groovy-4.0.19.jar!/:4.0.19]
        at groovy.lang.Binding.getProperty(Binding.java:117) ~[groovy-4.0.19.jar!/:4.0.19]
        at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:167) ~[groovy-4.0.19.jar!/:4.0.19]
        at groovy.lang.Closure.getPropertyTryThese(Closure.java:325) ~[groovy-4.0.19.jar!/:4.0.19]
        at groovy.lang.Closure.getPropertyDelegateFirst(Closure.java:315) ~[groovy-4.0.19.jar!/:4.0.19]
        at groovy.lang.Closure.getProperty(Closure.java:301) ~[groovy-4.0.19.jar!/:4.0.19]


What have i missed ? I just need to test some basic audit groovy script at the begining.

Ray Bon

unread,
May 14, 2024, 12:22:24 PM5/14/24
to cas-...@apereo.org
'customHttpRequestHeader' is only an example; you would have to define it as part of the groovy script (or add it to the headers somewhere else).

Ray


On Tue, 2024-05-14 at 04:57 -0700, artur mis wrote:
You don't often get email from artv...@gmail.com. Learn why this is important
Reply all
Reply to author
Forward
0 new messages