protected RegisteredService resolveRegisteredServiceInRequestContext(final RequestContext requestContext) throws Throwable {
        val resolvedService = resolveServiceFromAuthenticationRequest(requestContext);
        if (resolvedService != null) {
            val service = getConfigurationContext().getServicesManager().findServiceBy(resolvedService);
            RegisteredServiceAccessStrategyUtils.ensureServiceAccessIsAllowed(resolvedService, service);
            return service;
        }
        LOGGER.debug("Authentication request is not accompanied by a service given none is specified");
        return null;
    }
This is {@link BaseMultifactorAuthenticationProviderEventResolver}.

@author Misagh Moayyed
@since 5.1.0
core/cas-server-core-webflow-mfa-api/src/main/java/org/apereo/cas/web/flow/authentication/BaseMultifactorAuthenticationProviderEventResolver.java