We are unable to renew kerberos user tickets from keytab using java code, while it's working with "kinit -R"
code:
UserGroupInformation loginUser = UserGroupInformation.getLoginUser(); loginUser.checkTGTAndReloginFromKeytab();
Please help me out.
We are unable to renew kerberos user tickets from keytab using java code, while it's working with "kinit -R"
code:
UserGroupInformation loginUser = UserGroupInformation.getLoginUser(); loginUser.checkTGTAndReloginFromKeytab();
Please help me out.
Did you do a kinit before the process started? Only then it could be renewed.
Is the keytab under the same user that your program runs on? i.e. does the user have the rights to renew the keytab.
What is the exact stacktrace?
Maybe this will work for you, pointing to the exact location of your keytab. Because when you do a renewal when there is no keytab it is ofcourse pointless.
import org.apache.hadoop.security.UserGroupInformation;
org.apache.hadoop.conf.Configuration conf = new
org.apache.hadoop.conf.Configuration();
conf.set("hadoop.security.authentication", "Kerberos");
UserGroupInformation.setConfiguration(conf);
UserGroupInformation.loginUserFromKeytab("example_user@IBM.COM", "/path/to/example_user.keytab");