private Optional<SamlIdPSessionEntry> getSamlIdPSessionEntryFromRequest(final WebContext context, final Map<String, SamlIdPSessionEntry> ctx) {
        val applicationContext = openSamlConfigBean.getApplicationContext();
        val argumentExtractor = applicationContext.getBean(ArgumentExtractor.BEAN_NAME, ArgumentExtractor.class);
        val service = argumentExtractor.extractService(((JEEContext) context).getNativeRequest());
        return Optional.ofNullable(service)
            .map(Unchecked.function(__ -> {
                val serviceSelectionPlan = applicationContext.getBean(AuthenticationServiceSelectionPlan.BEAN_NAME, AuthenticationServiceSelectionPlan.class);
                val resolvedService = serviceSelectionPlan.resolveService(service);
                val authnRequestId = resolvedService.getAttributes().get(SamlIdPConstants.AUTHN_REQUEST_ID);
                return CollectionUtils.firstElement(authnRequestId)
                    .map(Object::toString)
                    .map(ctx::get)
                    .orElse(null);
            }));
    }
Retrieve saml request.

@param <T>          the type parameter
@param clazz        the clazz
@param requestValue the request value
@return the t
support/cas-server-support-saml-idp-core/src/main/java/org/apereo/cas/support/saml/idp/SamlIdPSessionManager.java