@CanIgnoreReturnValue
    public SamlIdPSessionManager store(final WebContext webContext,
                                       final Pair<? extends SignableSAMLObject, MessageContext> context) throws Exception {
        val authnRequest = (AuthnRequest) context.getLeft();
        val messageContext = context.getValue();
        try (val writer = SamlUtils.transformSamlObject(openSamlConfigBean, authnRequest)) {
            val samlRequest = EncodingUtils.encodeBase64(writer.toString().getBytes(StandardCharsets.UTF_8));
            val authnContext = SamlIdPAuthenticationContext.from(messageContext).encode();
            val entry = new SamlIdPSessionEntry()
                .setId(authnRequest.getID())
                .setSamlRequest(samlRequest)
                .setRelayState(SAMLBindingSupport.getRelayState(messageContext))
                .setContext(authnContext);
            val currentContext = sessionStore.get(webContext, SamlIdPSessionEntry.class.getName());
            val entries = currentContext.map(ctx -> (Map<String, SamlIdPSessionEntry>) ctx).orElseGet(HashMap::new);
            entries.put(entry.getId(), entry);
            sessionStore.set(webContext, SamlIdPSessionEntry.class.getName(), entries);
        }
        return this;
    }
Store saml request.

@param webContext the web context
@param context    the context
@return the saml id p session manager
@throws Exception the exception
support/cas-server-support-saml-idp-core/src/main/java/org/apereo/cas/support/saml/idp/SamlIdPSessionManager.java