private static Object fetchAttributeValueFromScript(final ExecutableCompiledScript script,
                                                        final Principal principal, final Service service) throws Throwable {
        val args = CollectionUtils.<String, Object>wrap("attributes", principal.getAttributes(),
            "id", principal.getId(),
            "service", service,
            "logger", LOGGER);
        script.setBinding(args);
        return script.execute(args.values().toArray(), Object.class);
    }
Resolves the username for the service to be the default principal id.

@author Misagh Moayyed
@since 4.1.0
core/cas-server-core-services-api/src/main/java/org/apereo/cas/services/GroovyRegisteredServiceUsernameProvider.java