public void login(HttpServletRequest httpRequest, HttpServletResponse httpResponse) {
      log.info("Starting DrupalAuth authentication");
      HttpSession session = httpRequest.getSession();
      session.setAttribute("drupalauth.authCookieName", authCookieName);
      session.setAttribute("drupalauth.authValidationEndpoint", authValidationEndpoint);
      session.setAttribute("drupalauth.drupalLoginURL", drupalLoginURL);
      session.setAttribute("drupalauth.xforwardedHeader", xforwardedHeader);
      session.setAttribute("drupalauth.validateSessionIP", validateSessionIP);
      session.setAttribute("drupalauth.parseLangQueryParams", parseLangQueryParams);

        // forward control to the servlet.
        try {
            StringBuilder pathBuilder = new StringBuilder();
            pathBuilder.append(httpRequest.getContextPath());
            if (!authenticationServletURL.startsWith("/")) {
                pathBuilder.append("/");
            }
            pathBuilder.append(authenticationServletURL);

            URLBuilder urlBuilder = new URLBuilder();
            urlBuilder.setScheme(httpRequest.getScheme());
            urlBuilder.setHost(httpRequest.getServerName());
            urlBuilder.setPort(httpRequest.getServerPort());
            urlBuilder.setPath(pathBuilder.toString());

            log.debug("Redirecting to {}", urlBuilder.buildURL());
            httpResponse.sendRedirect(urlBuilder.buildURL());
            return;
        } catch (IOException ex) {
            log.error("Unable to redirect to authentication servlet.", ex);
        }
    }