private static SAML2Configuration getSamlConfig(HiveConf conf) throws Exception {
    // by default the SAML2Client will create the keystore if the keystore path provided
    // doesn't exist. The directory where the keystore path is set must be accessible.
    SAML2Configuration saml2Configuration = new SAML2Configuration(
        conf.get(ConfVars.HIVE_SERVER2_SAML_KEYSTORE_PATH.varname),
        String.valueOf(
            conf.getPassword(ConfVars.HIVE_SERVER2_SAML_KEYSTORE_PASSWORD.varname)),
        String.valueOf(
            conf.getPassword(ConfVars.HIVE_SERVER2_SAML_PRIVATE_KEY_PASSWORD.varname)),
        conf.get(ConfVars.HIVE_SERVER2_SAML_IDP_METADATA.varname));
    saml2Configuration
        .setAuthnRequestBindingType(SAMLConstants.SAML2_REDIRECT_BINDING_URI);
    saml2Configuration.setResponseBindingType(SAML2_POST_BINDING_URI);
    saml2Configuration.setForceAuth(
        conf.getBoolean(ConfVars.HIVE_SERVER2_SAML_FORCE_AUTH.varname, false));
    saml2Configuration.setMaximumAuthenticationLifetime(
        ((int) conf.getTimeVar(ConfVars.HIVE_SERVER2_SAML_AUTHENTICATION_LIFETIME,
            TimeUnit.SECONDS)));
    String acsIndex = conf.get(ConfVars.HIVE_SERVER2_SAML_ACS_INDEX.varname, "");
    if (!acsIndex.isEmpty()) {
      saml2Configuration.setAssertionConsumerServiceIndex(
          conf.getIntVar(ConfVars.HIVE_SERVER2_SAML_ACS_INDEX));
    }
    String disallowedSignatureAlgos = conf
        .get(ConfVars.HIVE_SERVER2_SAML_BLACKLISTED_SIGNATURE_ALGORITHMS.varname,
            "");
    if (!disallowedSignatureAlgos.isEmpty()) {
      LOG.info(
          "List of disallowed signature algorithms: " + disallowedSignatureAlgos);
      List<String> blackListedSignAlgos = Splitter.on(',').splitToList(
          disallowedSignatureAlgos);
      saml2Configuration.setBlackListedSignatureSigningAlgorithms(blackListedSignAlgos);
    }
    // if the SP id is set use it else we configure the SP Id as the callback id.
    // this behavior IDP dependent. E.g. in case of Okta we can explicitly set a
    // different SP id.
    saml2Configuration.setServiceProviderEntityId(
        conf.get(ConfVars.HIVE_SERVER2_SAML_SP_ID.varname, getCallBackUrl(conf)));
    saml2Configuration.setWantsAssertionsSigned(
        conf.getBoolVar(ConfVars.HIVE_SERVER2_SAML_WANT_ASSERTIONS_SIGNED));
    saml2Configuration
        .setAuthnRequestSigned(conf.getBoolVar(ConfVars.HIVE_SERVER2_SAML_SIGN_REQUESTS));
    return saml2Configuration;
  }
Extracts the SAML specific configuration needed to initialize the SAML2.0 client.
service/src/java/org/apache/hive/service/auth/saml/HiveSaml2Client.java