code: public void login(Object userIdentifier) {
          session().put(config().sessionKeyUsername(), userIdentifier);
          app().eventBus().trigger(new LoginEvent(userIdentifier.toString()));
      }
docs: Update the context session to mark a user logged in
  
  @param userIdentifier
  the user identifier, could be either userId or username