@Override
    public boolean canImpersonateInternal(final String surrogate, final Principal principal, final Optional<? extends Service> service) throws Throwable {
        val args = new Object[]{surrogate, principal, service.orElse(null), LOGGER};
        return watchableScript.execute("canAuthenticate", Boolean.class, args);
    }
This is {@link GroovySurrogateAuthenticationService}.

@author Misagh Moayyed
@since 5.1.0
support/cas-server-support-surrogate-core/src/main/java/org/apereo/cas/authentication/surrogate/GroovySurrogateAuthenticationService.java