diff --git a/src/main/java/io/confluent/connect/hdfs/DataWriter.java b/src/main/java/io/confluent/connect/hdfs/DataWriter.java index 26ee8bb06..09ac84bee 100644 --- a/src/main/java/io/confluent/connect/hdfs/DataWriter.java +++ b/src/main/java/io/confluent/connect/hdfs/DataWriter.java @@ -274,7 +274,10 @@ private void configureKerberosAuthentication(Configuration hadoopConfiguration) hostname ); UserGroupInformation.loginUserFromKeytab(principal, connectorConfig.connectHdfsKeytab()); - final UserGroupInformation ugi = UserGroupInformation.getLoginUser(); + final UserGroupInformation ugi = UserGroupInformation.loginUserFromKeytabAndReturnUGI( + principal, + connectorConfig.connectHdfsKeytab() + ); log.info("Login as: " + ugi.getUserName()); isRunning = true;