maheshk114 commented on a change in pull request #793: HIVE-22267 : Support password based authentication for HMS along-side kerberos authentication. URL: https://github.com/apache/hive/pull/793#discussion_r331052667
########## File path: standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java ########## @@ -590,7 +592,30 @@ private void open() throws MetaException { transport = new TSocket(store.getHost(), store.getPort(), clientSocketTimeout); } - if (useSasl) { + if (usePasswordAuth) { + // we are using PLAIN Sasl connection with user/password + LOG.debug("HMSC::open(): Creating plain authentication thrift connection."); + String userName = MetastoreConf.getVar(conf, ConfVars.METASTORE_CLIENT_PLAIN_USERNAME); + // The password is not directly provided. It should be obtained from a keystore pointed + // by configuration "hadoop.security.credential.provider.path". + try { + String passwd = null; + char[] pwdCharArray = conf.getPassword(userName); + if (null != pwdCharArray) { + passwd = new String(pwdCharArray); + } Review comment: i think it should throw exception , if password is not giveen ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For additional commands, e-mail: gitbox-h...@hive.apache.org