@Override
    public Set<Event> resolveInternal(final RequestContext context) throws Throwable {
        val request = WebUtils.getHttpServletRequestFromExternalWebflowContext(context);
        val service = WebUtils.getRegisteredService(context);
        val authentication = WebUtils.getAuthentication(context);

        if (service == null || authentication == null) {
            LOGGER.debug("No service or authentication is available to determine event for principal");
            return null;
        }

        return handlePossibleSuspiciousAttempt(request, authentication, service);
    }
This is {@link RiskAwareAuthenticationWebflowEventResolver}.

@author Misagh Moayyed
@since 5.1.0
support/cas-server-support-electrofence/src/main/java/org/apereo/cas/web/flow/RiskAwareAuthenticationWebflowEventResolver.java