authName = "mixloginstatic";
}
this.responseString = authName;
} else {
try {
IUserManager userManager = serverManager.getUserManager();
user = userManager.login(name, password);
if (user != null) {
String redirect = (String) req.getSession().getAttribute(IDavinciServerConstants.REDIRECT_TO);
req.getSession().removeAttribute(IDavinciServerConstants.REDIRECT_TO); // burn after reading
this.responseString = (redirect != null) ? redirect : "OK";
HttpSession session = req.getSession(true);
session.setAttribute(IDavinciServerConstants.SESSION_USER, user);
session.setMaxInactiveInterval(IDavinciServerConstants.SESSION_TIMEOUT);
} else {
user = userManager.getUser(name);
if (user == null) {
resp.sendError(HttpServletResponse.SC_FORBIDDEN, "User not known");
} else {
resp.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Incorrect username/password");
}