protected SAML2Configuration getSaml2Configuration() {
        val cfg = new SAML2Configuration(new FileSystemResource("target/samlKeystore.jks"),
            "pac4j-demo-passwd",
            "pac4j-demo-passwd",
            new ClassPathResource("testshib-providers.xml"));

        cfg.setMaximumAuthenticationLifetime(3600);
        cfg.setAuthnRequestBindingType(getAuthnRequestBindingType());
        cfg.setServiceProviderEntityId("urn:mace:saml:pac4j.org");
        cfg.setForceServiceProviderMetadataGeneration(true);
        cfg.setForceKeystoreGeneration(true);
        cfg.setServiceProviderMetadataResource(new FileSystemResource(new File("target", "sp-metadata.xml").getAbsolutePath()));
        cfg.setSamlMessageStoreFactory(new HttpSessionStoreFactory());

        val attribute =
            new SAML2ServiceProviderRequestedAttribute("urn:oid:1.3.6.1.4.1.5923.1.1.1.6", "eduPersonPrincipalName");
        attribute.setServiceLang("fr");
        attribute.setServiceName("MySAML2ServiceProvider");
        cfg.getRequestedServiceProviderAttributes().add(attribute);

        return cfg;
    }
Abstract class to test the {@link SAML2Client}.
pac4j-saml/src/test/java/org/pac4j/saml/client/AbstractSAML2ClientTests.java