private static Map<String, String> getIdpEnv(boolean useSignedAssertions,
      String authMode) throws Exception {
    Map<String, String> idpEnv = new HashMap<>();
    idpEnv
        .put("SIMPLESAMLPHP_SP_ASSERTION_CONSUMER_SERVICE", HiveSamlUtils.getCallBackUri(
            miniHS2.getServerConf()).toString());
    idpEnv.put("SIMPLESAMLPHP_SP_ENTITY_ID",
        miniHS2.getHiveConf().get(ConfVars.HIVE_SERVER2_SAML_SP_ID.varname));
    idpEnv.put("SIMPLESAMLPHP_SP_NAME_ID_FORMAT",
        "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress");
    idpEnv.put("SIMPLESAMLPHP_SP_NAME_ID_ATTRIBUTE", "email");
    idpEnv.put("SIMPLESAMLPHP_IDP_AUTH", authMode);
    // by default idp signs the assertions
    if (!useSignedAssertions) {
      idpEnv.put("SIMPLESAMLPHP_SP_SIGN_ASSERTION", "false");
    }
    return idpEnv;
  }
End to end tests for the SAML based SSO authentication. The test instantiates a SAML
2.0 compliant IDP provider (SimpleSAMLPHP) in a docker container. The container is
configured such that it's IDP service is run on a random port which is available. See
{@link #setupIDP(boolean, String)} for details.
<p>
The HS2 is configured with the IDP's metadata file which is derived from a template.
The metadata file contains the IDP's public certificate. The template should be
post-processed to replace the port number where the service is running.
<p>
The test uses TestContainers library for managing the life-cycle of the IDP container.
It uses HTMLUnit to simulate the browser interaction (provide user/password) of the
end user.
itests/hive-unit/src/test/java/org/apache/hive/service/auth/saml/TestHttpSamlAuthentication.java