docs: @RequestMapping
      public void service(HttpServletRequest request, HttpServletResponse response)
              throws ServletException, IOException {
          response.setHeader("Pragma", "no-cache");
          response.setHeader("Cache-Control", "no-cache");
          response.setDateHeader("Expires", 0);
  
          // create the redirect URL, adding fname and args parameters if necessary
          String redirectTarget = null;
  
          final String refUrl = request.getParameter(REFERER_URL_PARAM);
          final URL redirectLocation = parseLocalRefUrl(request, refUrl);
          if (redirectLocation != null) {
              redirectTarget = redirectLocation.toString();
          }
  
          if (redirectTarget == null) {
              /* Grab the target functional name, if any, off the login request.
               * Also any arguments for the target. We will pass them  along after authentication.
               */
              String targetFname = request.getParameter("uP_fname");
  
              if (targetFname == null) {
                  final IPortalUrlBuilder defaultUrl = this.portalUrlProvider.getDefaultUrl(request);
                  redirectTarget = defaultUrl.getUrlString();
              } else {
                  try {
                      final IPortalUrlBuilder urlBuilder =
                              this.portalUrlProvider.getPortalUrlBuilderByPortletFName(
                                      request, targetFname, UrlType.RENDER);
  
                      Enumeration<String> e = request.getParameterNames();
                      while (e.hasMoreElements()) {
                          String paramName = e.nextElement();
                          if (!paramName.equals("uP_fname")) {
                              urlBuilder.addParameter(
                                      paramName, request.getParameterValues(paramName));
                          }
                      }
  
                      redirectTarget = urlBuilder.getUrlString();
                  } catch (IllegalArgumentException e) {
                      final IPortalUrlBuilder defaultUrl =
                              this.portalUrlProvider.getDefaultUrl(request);
                      redirectTarget = defaultUrl.getUrlString();
                  }
              }
          }
  
          IPerson person = null;
  
          final Object authError =
                  request.getSession(false).getAttribute(LoginController.AUTH_ERROR_KEY);
          if (authError == null || !((Boolean) authError)) {
              person = this.personManager.getPerson(request);
          }
  
          if (person == null || !person.getSecurityContext().isAuthenticated()) {
              if (request.getMethod().equals("POST"))
                  request.getSession(false).setAttribute(AUTH_ATTEMPTED_KEY, "true");
              // Preserve the attempted username so it can be redisplayed to the user
              String attemptedUserName = request.getParameter("userName");
              if (attemptedUserName != null)
                  request.getSession(false)
                          .setAttribute(ATTEMPTED_USERNAME_KEY, request.getParameter("userName"));
          }
  
          final String encodedRedirectURL = response.encodeRedirectURL(redirectTarget);
  
          if (log.isDebugEnabled()) {
              log.debug("Redirecting to " + redirectTarget);
          }
  
          response.sendRedirect(encodedRedirectURL);
      }