@Override
    public AuthenticationPolicyExecutionResult isSatisfiedBy(
        final Authentication authentication,
        final Set<AuthenticationHandler> authenticationHandlers,
        final ConfigurableApplicationContext applicationContext,
        final Map<String, ? extends Serializable> context) throws Throwable {

        initializeWatchableScriptIfNeeded();

        val args = CollectionUtils.<String, Object>wrap(
            "authentication", authentication,
            "context", context,
            "applicationContext", applicationContext,
            "logger", LOGGER);
        executableScript.setBinding(args);
        val ex = executableScript.execute(args.values().toArray(), Optional.class);
        if (ex != null && ex.isPresent()) {
            val exception = (Exception) ex.get();
            throw new GeneralSecurityException(exception);
        }
        return AuthenticationPolicyExecutionResult.success();
    }
This is {@link GroovyScriptAuthenticationPolicy}.

@author Misagh Moayyed
@since 5.2.0
core/cas-server-core-authentication-api/src/main/java/org/apereo/cas/authentication/policy/GroovyScriptAuthenticationPolicy.java