protected String getSessionIndex(final Assertion subjectAssertion) {
        val authnStatements = subjectAssertion.getAuthnStatements();
        if (authnStatements != null && !authnStatements.isEmpty()) {
            val statement = authnStatements.get(0);
            if (statement != null) {
                return statement.getSessionIndex();
            }
        }
        return null;
    }
Searches the sessionIndex in the assertion

@param subjectAssertion assertion from the response
@return the sessionIndex if found in the assertion
pac4j-saml/src/main/java/org/pac4j/saml/sso/impl/SAML2AuthnResponseValidator.java