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 July 8, 2016.
<< Integrating Hadoop Security with Alternate Authentication | ©2016 Cloudera, Inc. All rights reserved | Using a Web Browser to Access an URL Protected by Kerberos HTTP SPNEGO >> |
Terms and Conditions Privacy Policy |