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;
      }
      // add the logged in user into subject
      if (mUser != null) {
        mSubject.getPrincipals().add(mUser);
        return true;
      }
      // throw exception if no Alluxio user is found or created.
      throw new LoginException("Cannot find a user");
    }
docs: Commits the authentication (second phase).
  
  <p>
  This method is called if the LoginContext's overall authentication succeeded. The
  implementation first checks if there is already Alluxio user in the subject. If not, it adds
  the previously logged in Alluxio user into the subject.
  
  @return true if an Alluxio user is found or created
  @throws LoginException not Alluxio user is found or created