code: @Override
    public boolean commit() throws LoginException {
      // if there is already an Alluxio user, it's done.
      if (!mSubject.getPrincipals(User.class).isEmpty()) {
        return true;
      }
  
      Principal user = null;
  
      // TODO(dong): get a Kerberos user if we are using Kerberos.
      // user = getKerberosUser();
  
      // get a OS user
      if (user == null) {
        user = getPrincipalUser(LoginModuleConfigurationUtils.OS_PRINCIPAL_CLASS_NAME);
      }
  
      // if a user is found, convert it to an Alluxio user and save it.
      if (user != null) {
        mUser = new User(user.getName());
        mSubject.getPrincipals().add(mUser);
        return true;
      }
  
      throw new LoginException("Cannot find a user");
    }
docs: Commits the authentication (second phase).
  
  This method is called if the LoginContext's overall authentication succeeded. (login
  succeeded)
  The implementation searches the Kerberos or OS user in the Subject. If existed,
  convert it to an Alluxio user and add into the Subject.
  @return true in all cases
  @throws LoginException if the user extending a specific Principal is not found