getSiteAuth().startAuthentication(context, request, response);
Iterator ai = AuthenticationManager.authenticationMethodIterator(); AuthenticationMethod am; int count = 0; String url = null; while (ai.hasNext()) { String s; am = (AuthenticationMethod)ai.next(); if ((s = am.loginPageURL(context, request, response)) != null) { url = s; ++count; } } if (count == 1) response.sendRedirect(url); else JSPManager.showJSP(request, response, "/login/chooser.jsp"); } return false;
    public static void startAuthentication(Context context,            HttpServletRequest request, HttpServletResponse response)            throws ServletException, IOException    {        HttpSession session = request.getSession();        // Since we may be doing a redirect, make sure the redirect is not        // cached        response.addDateHeader("expires", 1);        response.addHeader("Pragma", "no-cache");        response.addHeader("Cache-control", "no-store");        // Store the data from the request that led to authentication        RequestInfo info = new RequestInfo(request);        session.setAttribute("interrupted.request.info", info);        // Store the URL of the request that led to authentication        session.setAttribute("interrupted.request.url", UIUtil                .getOriginalURL(request));        // Start up the site authenticator        getSiteAuth().startAuthentication(context, request, response);    }