Examples of LoginAttemptBO


Examples of edu.asu.securebanking.businessobject.LoginAttemptBO

      @RequestParam("j_password")String pwd, HttpServletRequest req) {

    System.out.println("show me the way!!!");
    ApplicationContext appContext = new ClassPathXmlApplicationContext("spring/config/BeanLocations.xml");

    LoginAttemptBO loginAttemptBO = (LoginAttemptBO)appContext.getBean("loginAttemptBO");

    String role = "";

    String remoteAddr = req.getRemoteAddr();
    ReCaptchaImpl reCaptcha = new ReCaptchaImpl();
View Full Code Here

Examples of edu.asu.securebanking.businessobject.LoginAttemptBO

      @RequestParam("j_password")String pwd, HttpServletRequest req) {

    System.out.println("show me the way!!!");
    ApplicationContext appContext = new ClassPathXmlApplicationContext("spring/config/BeanLocations.xml");

    LoginAttemptBO loginAttemptBO = (LoginAttemptBO)appContext.getBean("loginAttemptBO");

    String role = "";

    String remoteAddr = req.getRemoteAddr();
    ReCaptchaImpl reCaptcha = new ReCaptchaImpl();
View Full Code Here

Examples of edu.asu.securebanking.businessobject.LoginAttemptBO

    String name = principal.getName();

    ApplicationContext appContext = new ClassPathXmlApplicationContext("spring/config/BeanLocations.xml");
    LoginAttemptBO loginAttemptBO = (LoginAttemptBO)appContext.getBean("loginAttemptBO");
    OTPBO otpBO = (OTPBO)appContext.getBean("OTPBO");

   


    int userid = 0;
    int empid = 0;
    String email = null;
    String username = name;
    boolean ftl = false;
    InternalAccount ia=null;
    ExternalAccount ea = loginAttemptBO.findAccountByNameExternal(name);
    if(ea == null){
      ia = loginAttemptBO.findAccountByNameInternal(name);
      if(ia != null){
        userid = 0;
        empid = ia.getEmployeeId();
        email = ia.getEmail();
        ftl = ia.getFirstTimeLogin();
View Full Code Here

Examples of edu.asu.securebanking.businessobject.LoginAttemptBO

   
    String oneTimePassword = otp.getotp();
 
    // Get the object from the OTP table
    ApplicationContext appContext = new ClassPathXmlApplicationContext("spring/config/BeanLocations.xml");
    LoginAttemptBO loginAttemptBO = (LoginAttemptBO)appContext.getBean("loginAttemptBO");
    OTPBO otpBO = (OTPBO)appContext.getBean("OTPBO");
   
    int userid=0;
    int empid=0;
    InternalAccount ia = null;
    String name = principal.getName();
   
    ExternalAccount ea = loginAttemptBO.findAccountByNameExternal(name);
    if(ea == null){
      ia = loginAttemptBO.findAccountByNameInternal(name);
      if(ia != null){
        userid = 0;
        empid = ia.getEmployeeId();
       
      }
View Full Code Here

Examples of edu.asu.securebanking.businessobject.LoginAttemptBO

 
        return "ForgetPassword";

    } else{
    ApplicationContext appContext = new ClassPathXmlApplicationContext("spring/config/BeanLocations.xml");
    LoginAttemptBO loginAttemptBO = (LoginAttemptBO)appContext.getBean("loginAttemptBO");
       CreateExternalAccountBO createExternalAccountBO = (CreateExternalAccountBO)appContext.getBean("createExternalAccountBO");
       CreateInternalAccountBO createInternalAccountBO = (CreateInternalAccountBO)appContext.getBean("createInternalAccountBO");

    String userType = loginAttemptBO.findRecoveryAccount(forgot_user.getUsername(),
        forgot_user.getEmail(), forgot_user.getTelephone(),
        forgot_user.getSecurityquestion(), forgot_user.getSecurityanswer());
    String otp_pwd = this.generateOTP();
   
    //find user from database and update password
   
    if(userType == "INTERNAL"){
      InternalAccount ia = loginAttemptBO.findAccountByNameInternal(forgot_user.getUsername());
      if(ia != null)
      {
          try{
              MessageDigest digest = MessageDigest.getInstance("SHA-256");
              byte[] hash = digest.digest(otp_pwd.getBytes("UTF-8"));
              StringBuffer hexString = new StringBuffer();

              for (int i = 0; i < hash.length; i++) {
                  String hex = Integer.toHexString(0xff & hash[i]);
                  if(hex.length() == 1) hexString.append('0');
                  hexString.append(hex);
              }
              this.sendPwdRecoveryEmail(ia.getEmail(), ia.getUsername(), otp_pwd);
              ia.setPassword(hexString.toString());
              //ia.setPassword(otp_pwd);
              createInternalAccountBO.update(ia);
          } catch(Exception ex){
             throw new RuntimeException(ex);
          }
      }
      else
      {
        //both are null --> there's no matching table
        return "redirect:/j_spring_security_logout";
      }
     
    }
    else if(userType == "EXTERNAL")
    {
      //external use case
      ExternalAccount ea = loginAttemptBO.findAccountByNameExternal(forgot_user.getUsername());
      if(ea != null)
      {
        try{
          MessageDigest digest = MessageDigest.getInstance("SHA-256");
          byte[] hash = digest.digest(otp_pwd.getBytes("UTF-8"));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.