public Object authenticate(String username, String password, Object context) { String ticket = null; db = (AccessDatabase)context; try { ticket = db.getTicket(username, password); } catch (AccessDatabaseError e) { throw new AuthenticateExceptionInvalidCredentials(); } catch (Exception e2) { // A temporary exception, retry later throw new AuthenticateException(e2.ToString()); } return(ticket); }