diff --git a/src/org/openbravo/demo/loginpage/authentication/DemoAuthenticationManager.java b/src/org/openbravo/demo/loginpage/authentication/DemoAuthenticationManager.java
--- a/src/org/openbravo/demo/loginpage/authentication/DemoAuthenticationManager.java
+++ b/src/org/openbravo/demo/loginpage/authentication/DemoAuthenticationManager.java
@@ -20,15 +20,12 @@
 package org.openbravo.demo.loginpage.authentication;
 
 import java.io.IOException;
-import java.io.PrintWriter;
 
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
 
-import org.apache.log4j.Logger;
 import org.openbravo.authentication.AuthenticationException;
 import org.openbravo.authentication.AuthenticationManager;
 import org.openbravo.base.HttpBaseUtils;
@@ -36,45 +33,40 @@
 import org.openbravo.database.ConnectionProvider;
 import org.openbravo.erpCommon.utility.Utility;
 
-public class DemoAuthenticationManager implements AuthenticationManager {
+public class DemoAuthenticationManager extends AuthenticationManager {
 
-  private ConnectionProvider conn = null;
-  private String strServletSinIdentificar = null;
-  private Logger log4j = Logger.getLogger(DemoAuthenticationManager.class);
-
-  /** Creates a new instance of DefaultAuthenticationManager */
   public DemoAuthenticationManager() {
   }
 
+  public DemoAuthenticationManager(HttpServlet s) throws AuthenticationException {
+    super(s);
+  }
+
+  @Override
   public void init(HttpServlet s) throws AuthenticationException {
+
+    super.init(s);
+
     if (s instanceof ConnectionProvider) {
-      conn = (ConnectionProvider) s;
-      strServletSinIdentificar = "/org.openbravo.demo.loginpage.utility/LogDemo.html";
-      // strServletSinIdentificar = s.getServletConfig().getServletContext().getInitParameter(
-      // "ServletSinIdentificar");
+      defaultServletUrl = "/org.openbravo.demo.loginpage.utility/LogDemo.html";
     } else {
       throw new AuthenticationException("Connection provider required for default authentication");
     }
   }
 
-  public String authenticate(HttpServletRequest request, HttpServletResponse response)
+  @Override
+  protected String doAuthenticate(HttpServletRequest request, HttpServletResponse response)
       throws AuthenticationException, ServletException, IOException {
     String sUserId = (String) request.getSession(true).getAttribute("#Authenticated_user");
 
     if (sUserId == null || sUserId.equals("")) {
       String strAjax = "";
-      // strHidden and strPopUp not implemented
-      /*
-       * String strHidden = ""; String strPopUp = "";
-       */
+
       try {
         strAjax = request.getParameter("IsAjaxCall");
       } catch (Exception ignored) {
       }
-      /*
-       * try { strHidden = request.getParameter("IsHiddenCall"); } catch (Exception ignored) {} try
-       * { strPopUp = request.getParameter("IsPopUpCall"); } catch (Exception ignored) {}
-       */
+
       VariablesHistory variables = new VariablesHistory(request);
 
       // redirects to the menu or the menu with the target
@@ -92,42 +84,22 @@
           + (qString != null && !qString.equals("") ? "?" + qString : ""));
 
       if (strAjax != null && !strAjax.equals(""))
-        bdErrorAjax(response, "Error", "", Utility.messageBD(this.conn, "NotLogged", variables
-            .getLanguage()));
+        bdErrorAjax(response, "Error", "",
+            Utility.messageBD(this.conn, "NotLogged", variables.getLanguage()));
       else
-        response.sendRedirect(strDireccionLocal + strServletSinIdentificar);
+        response.sendRedirect(strDireccionLocal + defaultServletUrl);
       return null;
     } else {
       return sUserId;
     }
   }
 
-  private void bdErrorAjax(HttpServletResponse response, String strType, String strTitle,
-      String strText) throws IOException {
-    response.setContentType("text/xml; charset=UTF-8");
-    PrintWriter out = response.getWriter();
-    out.println("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n");
-    out.println("<xml-structure>\n");
-    out.println("  <status>\n");
-    out.println("    <type>" + strType + "</type>\n");
-    out.println("    <title>" + strTitle + "</title>\n");
-    out.println("    <description><![CDATA[" + strText + "]]></description>\n");
-    out.println("  </status>\n");
-    out.println("</xml-structure>\n");
-    out.close();
-  }
-
-  public void logout(HttpServletRequest request, HttpServletResponse response)
+  @Override
+  protected void doLogout(HttpServletRequest request, HttpServletResponse response)
       throws ServletException, IOException {
 
-    // if HttpSession is still valid, then 'logout' by removing #Authenticated_user from it
-    HttpSession session = request.getSession(false);
-    if (session != null) {
-      session.removeAttribute("#Authenticated_user");
+    if (!response.isCommitted()) {
+      response.sendRedirect(HttpBaseUtils.getLocalAddress(request));
     }
-
-    if (!response.isCommitted())
-      response.sendRedirect(HttpBaseUtils.getLocalAddress(request));
   }
-
 }
