public void showLogin(HttpServletRequest request, HttpServletResponse response, XWikiContext context) throws IOException { showLogin(request, response, realmName); } }
public boolean processLogin(SecurityRequestWrapper request, HttpServletResponse response, XWikiContext context) throws Exception { Principal principal = checkLogin(request, response, context); if (principal == null) { // login failed // show the basic authentication window again. showLogin(request.getCurrentRequest(), response); return true; } return false; }
/** * Show the login page. * * @param request the current request * @param response the current response */ public void showLogin(HttpServletRequest request, HttpServletResponse response, XWikiContext context) throws IOException { if ("1".equals(request.getParameter("basicauth"))) { String realmName = context.getWiki().Param("xwiki.authentication.realmname"); if (realmName == null) { realmName = "XWiki"; } MyBasicAuthenticator.showLogin(request, response, realmName); } else { showLogin(request, response); } }
public boolean processLogin(String username, String password, String rememberme, SecurityRequestWrapper request, HttpServletResponse response, XWikiContext context) throws Exception { Principal principal = authenticate(username, password, context); if (principal != null) { // login successful request.getSession().removeAttribute(LOGIN_ATTEMPTS); // make sure the Principal contains wiki name information if (!StringUtils.contains(principal.getName(), ':')) { principal = new SimplePrincipal(context.getDatabase() + ":" + principal.getName()); } request.setUserPrincipal(principal); return false; } else { // login failed // show the basic authentication window again. showLogin(request.getCurrentRequest(), response); return true; } }