private void loginUser(HttpServletRequest request, HttpServletResponse response) throws IOException {
Map<String, Object> responseData = new HashMap<String, Object>();
HttpSession session = request.getSession();
User user = (User) session.getAttribute("user");
BaseProvider provider = Config.getProvider();
if(user == null) {
user = provider.login(request);
}
if (user == null) {
responseData.put(LOGIN_STATUS_FIELD, false);
String form = provider.getLoginForm();
if (form != null) {
responseData.put(LOGIN_FORM_FIELD, form);
}
} else {
responseData.put(LOGIN_STATUS_FIELD, true);