private void processArtifact(final MessageContext messageContext, final WebContext webContext)
        throws MessageDecodingException {

        val encodedArtifact = StringSupport.trimOrNull(webContext.getRequestParameter("SAMLart").orElse(null));
        if (encodedArtifact == null) {
            LOGGER.error("URL SAMLart parameter was missing or did not contain a value.");
            throw new MessageDecodingException("URL SAMLart parameter was missing or did not contain a value.");
        }

        try {
            val artifact = parseArtifact(encodedArtifact);

            val peerRoleDescriptor = resolvePeerRoleDescriptor(artifact);
            if (peerRoleDescriptor == null) {
                throw new MessageDecodingException("Failed to resolve peer RoleDescriptor based on inbound artifact");
            }

            val ars = resolveArtifactEndpoint(artifact, peerRoleDescriptor);

            val inboundMessage = dereferenceArtifact(artifact, peerRoleDescriptor, ars);

            messageContext.setMessage(inboundMessage);
        } catch (final MessageDecodingException e) {
            throw e;
        } catch (final Exception e) {
            throw new MessageDecodingException("Fatal error decoding or resolving inbound artifact", e);
        }
    }
Process the incoming artifact by decoding the artifacts, dereferencing it from the artifact issuer and
storing the resulting protocol message in the message context.

@param messageContext the message context being processed
@param webContext     the web context
@throws MessageDecodingException thrown if there is a problem decoding or dereferencing the artifact
pac4j-saml/src/main/java/org/pac4j/saml/transport/Pac4jHTTPArtifactDecoder.java