|
@@ -178,7 +178,21 @@ public class UserGroupInformation {
|
|
}
|
|
}
|
|
// if we found the user, add our principal
|
|
// if we found the user, add our principal
|
|
if (user != null) {
|
|
if (user != null) {
|
|
- subject.getPrincipals().add(new User(user.getName()));
|
|
|
|
|
|
+ if (LOG.isDebugEnabled()) {
|
|
|
|
+ LOG.debug("Using user: \"" + user + "\" with name " + user.getName());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ User userEntry = null;
|
|
|
|
+ try {
|
|
|
|
+ userEntry = new User(user.getName());
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ throw (LoginException)(new LoginException(e.toString()).initCause(e));
|
|
|
|
+ }
|
|
|
|
+ if (LOG.isDebugEnabled()) {
|
|
|
|
+ LOG.debug("User entry: \"" + userEntry.toString() + "\"" );
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ subject.getPrincipals().add(userEntry);
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
LOG.error("Can't find user in " + subject);
|
|
LOG.error("Can't find user in " + subject);
|
|
@@ -931,7 +945,7 @@ public class UserGroupInformation {
|
|
metrics.loginFailure.add(Time.now() - start);
|
|
metrics.loginFailure.add(Time.now() - start);
|
|
}
|
|
}
|
|
throw new IOException("Login failure for " + user + " from keytab " +
|
|
throw new IOException("Login failure for " + user + " from keytab " +
|
|
- path, le);
|
|
|
|
|
|
+ path+ ": " + le, le);
|
|
}
|
|
}
|
|
LOG.info("Login successful for user " + keytabPrincipal
|
|
LOG.info("Login successful for user " + keytabPrincipal
|
|
+ " using keytab file " + keytabFile);
|
|
+ " using keytab file " + keytabFile);
|