code: public User requireUser (HttpServletRequest req)
          throws PersistenceException, RedirectException
      {
          User user = loadUser(req);
          // if no user was loaded, we need to redirect these fine people to the login page
          if (user == null) {
              // first construct the redirect URL
              String eurl = RequestUtils.getLocationEncoded(req);
              String target = _loginURL.replace("%R", eurl);
              if (USERMGR_DEBUG) {
                  log.info("No user found in require, redirecting", "to", target);
              }
              throw new RedirectException(target);
          }
          return user;
      }
docs: Fetches the necessary authentication information from the http request and loads the user
  identified by that information. If no user could be loaded (because the requester is not
  authenticated), a redirect exception will be thrown to redirect the user to the login page
  specified in the user manager configuration.
  
  @return the user associated with the request.