"usernameAttributeProvider" : {
"@class" : "org.apereo.cas.services.GroovyRegisteredServiceUsernameProvider",
"groovyScript" : "groovy { return '20115-'+attributes['cn'][0] }"
},
2019-03-05 11:39:22,003 DEBUG [org.apereo.cas.services.GroovyRegisteredServiceUsernameProvider] - <Found groovy script to execute [groovy { return '20115-'+attributes['cn'][0] }]>
2019-03-05 11:39:22,003 DEBUG [org.apereo.cas.util.ScriptingUtils] - <Executing groovy script [return '20115-'+attributes['cn'][0] ] with variables [{attributes={cn=[admin], givenName=[Admin], mail=[admin@host.local], sn=[Admininstrator]}, id=admin@host.local, logger=org.apache.logging.slf4j.Log4jLogger@6534b155}]>
2019-03-05 11:39:28,706 DEBUG [org.apereo.cas.services.GroovyRegisteredServiceUsernameProvider] - <Found username [20115-admin] from script [groovy { return '20115-'+attributes['cn'][0] }]>
2019-03-05 11:39:28,706 DEBUG [org.apereo.cas.services.BaseRegisteredServiceUsernameAttributeProvider] - <Resolved username for [https://localhost] is [20115-admin]>public static <T> T executeGroovyShellScript(final String script, final Map<String, Object> variables, final Class<T> clazz) { try { final Binding binding = new Binding(); final GroovyShell shell = new GroovyShell(binding); if (variables != null && !variables.isEmpty()) { variables.forEach(binding::setVariable); } if (!binding.hasVariable("logger")) { binding.setVariable("logger", LOGGER); } LOGGER.debug("Executing groovy script [{}] with variables [{}]", script, binding.getVariables());
final Object result = shell.evaluate(script); if (result != null && !clazz.isAssignableFrom(result.getClass())) { throw new ClassCastException("Result [" + result + " is of type " + result.getClass() + " when we were expecting " + clazz); } return (T) result;
} catch (final Exception e) { LOGGER.error(e.getMessage(), e); } return null; }I ran a single login through a profiler and it confirms that most of the time is spent evaluating the script. That said, most of the time in evaluating is in class loading. I'm still not sure how to speed this up but getting closer to identifying the root problem.

--
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
---
You received this message because you are subscribed to the Google Groups "CAS Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+u...@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/8b9ff5cf-16bd-4345-be12-5b1a6a6688f7%40apereo.org.
You received this message because you are subscribed to a topic in the Google Groups "CAS Community" group.
To unsubscribe from this topic, visit https://groups.google.com/a/apereo.org/d/topic/cas-user/iNm7khTNLxo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cas-user+u...@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/CAJ%3D0EZzabP%3DYJHghCaDAzvuPu1inC%2BKMQnFm3thNiWaYCqzvVw%40mail.gmail.com.