Package com.cosmo.security.auth

Examples of com.cosmo.security.auth.AuthenticationException


         int statusCode = httpClient.executeMethod(method);
        
         if (statusCode != HttpStatus.SC_OK)
         {
            method.releaseConnection();
            throw new AuthenticationException("El servidor de CAS no ha respondido correctamente a la llamada de validaci�n de la autenticaci�n (CAS ticket=" + serviceTicket + ").");
         }
         else
        
            String resp = new String(method.getResponseBody());           
            user = getUserDataFromValidation(resp);

            // result = extractUser(new String(method.getResponseBody()));
         }
      }
      catch (IOException ex)
      {
         throw new AuthenticationException(ex.getMessage(), ex);
      }
      catch (AuthenticationException ex)
      {
         throw ex;
      }
View Full Code Here


        
         return user;
      }
      catch (ParserConfigurationException ex)
      {
         throw new AuthenticationException(ex.getMessage(), ex);
      }
      catch (SAXException ex)
      {
         throw new AuthenticationException(ex.getMessage(), ex);
      }
      catch (IOException ex)
      {
         throw new AuthenticationException(ex.getMessage(), ex);
      }
   }
View Full Code Here

         // Obtiene el usuario y genera una nueva sesi�n
         User user = auth.getLoginGatewayUser(request);

         if (user == null)
         {
            throw new AuthenticationException("El proveedor de seguridad no pudo obtener las credenciales del usuario autenticado. La autenticaci�n ha fallado.");
         }

         workspace.createUserSession(user);

         if (isAuthenticationForm(page))
View Full Code Here

            this.securityInfo = new UserSecurityPolicy();
         }
      }
      else
      {
         throw new AuthenticationException("La seguridad no est� habilitada para este workspace.");
      }
   }
View Full Code Here

      // Verifica que la seguridad se encuentre habilitada
      Authentication authenticator = AuthenticationFactory.getInstance(workspace);
      if (authenticator == null)
      {
         throw new AuthenticationException("La seguridad no est� habilitada para este workspace.");
      }

      // Establece el usuario actual
      this.currentUser = user;
View Full Code Here

         int timeout = agent.getParamInteger(PARAM_TIMEOUT, 30);

         // Determina si la cuenta del usuario est� o no bloqueada
         if (isLocked(login, attemps, timeout))
         {
            throw new AuthenticationException("La cuenta " + login + " est� bloqueada.");
         }
      }

      try
      {
         sql = "SELECT * " +
               "FROM  " + TABLE_NAME + " " +
               "WHERE Lower(usrlogin) = '" + login.trim().toLowerCase() + "' And " +
               "      usrpwd = '" + CryptoUtils.encrypt(password) + "'";

         conn = DataFactory.getInstance(workspace);
         // ds = this.workspace.getProperties().getDataProperties().getDataSource();
         // conn = new DataConnection(ds);
         // conn.connect();
         ResultSet rs = conn.executeSql(sql);
         if (rs.next())
         {
            user = new User();
            user.setLogin(rs.getString("usrlogin"));
            user.setMail(rs.getString("usrmail"));
            user.setName(rs.getString("usrname"));
            user.setCreated(rs.getDate("usrcreated"));
            user.setLastLogin(rs.getDate("usrlastlogin"));
            user.setLogonCount(rs.getInt("usrlogoncount"));
         }
         else
         {
            // Si tiene el control de bloqueo activado, actualiza la informaci�n de bloqueo
            if (agent.getParamBoolean(PARAM_LOCKCONTROL, false))
            {
               loginFail(login);
            }

            throw new UserNotFoundException();
         }

         // Actualiza los datos estadísticos y de control del usuario
         sql = "UPDATE " + TABLE_NAME + " " +
               "SET usrlastlogin  = current_timestamp, " +
               "    usrlogoncount = usrlogoncount + 1 " +
               "WHERE Lower(usrlogin) = '" + login.trim().toLowerCase() + "'";
         conn.execute(sql);

         // Confirma los cambios en la bbdd
         if (!conn.isAutoCommit()) conn.commit();
      }
      catch (SQLException ex)
      {
         throw new AuthenticationException(ex.getMessage(), ex);
      }
      catch (GeneralSecurityException ex)
      {
         throw new AuthenticationException(ex.getMessage(), ex);
      }
      catch (UserNotFoundException ex)
      {
         throw ex;
      }
      catch (Exception ex)
      {
         throw new AuthenticationException(ex.getMessage(), ex);
      }
      finally
      {
         conn.disconnect();
      }             
View Full Code Here

         return (conn.executeScalar(sSQL) > 0);
      }
      catch (Exception ex)
      {
         throw new AuthenticationException(ex.getMessage(), ex);
      }
      finally
      {
         conn.disconnect();
      }
View Full Code Here

         // Confirma los cambios en la bbdd
         if (!conn.isAutoCommit()) conn.commit();
      }
      catch (Exception ex)
      {
         throw new AuthenticationException(ex.getMessage(), ex);
      }
      finally
      {
         // conn.disconnect();
      }
View Full Code Here

         // Confirma los cambios en la bbdd
         if (!conn.isAutoCommit()) conn.commit();
      }
      catch (Exception ex)
      {
         throw new AuthenticationException(ex.getMessage(), ex);
      }
      finally
      {
         if (conn != null)
         {
View Full Code Here

         // Confirma los cambios en la bbdd
         if (!conn.isAutoCommit()) conn.commit();
      }
      catch (Exception ex)
      {
         throw new AuthenticationException(ex.getMessage(), ex);
      }
      finally
      {
         if (conn != null)
         {
View Full Code Here

TOP

Related Classes of com.cosmo.security.auth.AuthenticationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.