public static RegisteredService getRegisteredService(final RequestContext context) {
        return Optional.ofNullable(context)
            .map(requestContext -> (RegisteredService)
                requestContext.getFlowScope().get(CasWebflowConstants.ATTRIBUTE_REGISTERED_SERVICE)).orElse(null);
    }
Gets the registered service from the flow scope.

@param context the context
@return the service
core/cas-server-core-web-api/src/main/java/org/apereo/cas/web/support/WebUtils.java