Authenticating Kerberos Principals in Java Code
This topic provides an example of how to authenticate a Kerberos principal in a Java application using the org.apache.hadoop.security.UserGroupInformation class.
The following code snippet authenticates the cloudera principal using the cloudera.keytab file:
// Authenticating Kerberos principal System.out.println("Principal Authentication: "); final String user = "cloudera@CLOUDERA.COM"; final String keyPath = "cloudera.keytab"; UserGroupInformation.loginUserFromKeytab(user, keyPath);
Page generated August 14, 2017.
<< Integrating Hadoop Security with Alternate Authentication | ©2016 Cloudera, Inc. All rights reserved | Configuring Encryption >> |
Terms and Conditions Privacy Policy |