forwardToLoginPage(request, response, config);
return (AuthStatus.SEND_CONTINUE);
}
// yes - validate the specified credentials and redirect to the error page if they are not correct
Realm realm = context.getRealm();
String characterEncoding = request.getCharacterEncoding();
if (characterEncoding != null) {
try {
request.setCharacterEncoding(characterEncoding);
} catch (UnsupportedEncodingException e) {
WebLogger.WEB_SECURITY_LOGGER.unsupportedEncoding(e.getLocalizedMessage());
}
}
String username = request.getParameter(Constants.FORM_USERNAME);
String password = request.getParameter(Constants.FORM_PASSWORD);
WebLogger.WEB_SECURITY_LOGGER.tracef("Authenticating username '%s'", username);
principal = realm.authenticate(username, password);
if (principal == null) {
forwardToErrorPage(request, response, config);
return (AuthStatus.FAILURE);
}