Hi Chhaya, 

You can use the UserGroupInformation class from org.apache.hadoop.security 
package. 

Specifically following 2 methods of that class 

UserGroupInformation.setConfiguration(hdfsConfiguration); 
UserGroupInformation.loginUserFromKeytab(principal, keytabPath);

Regards,
Niranjan

On 02-Nov-2015, at 4:15 pm, Vishwakarma, Chhaya 
<[email protected]> wrote:

> I have Kerberos enabled Hadoop cluster, I need to perform HDFS operations 
> using JAVA code.
> 
> I have keytab file and username can someone please suggest how can I 
> autheticate to Kerberos using JAVA code?
> 
> Regards,
> Chhaya

Reply via email to