Package edu.asu.securebanking.model

Examples of edu.asu.securebanking.model.OTP


  }

  @Override
  public OTP findAccountByName(int userid, int empid) {
    // TODO Auto-generated method stub
    OTP result = OTPDao.findAccountByNameExternal(userid, empid);

    if(result == null){
      return null;
    }
View Full Code Here


      ftl = ea.isFirstTimeLogin();
    }
    if(ftl == true){
      // First Time Login
      //store OTP data to otp DB
      OTP instance = new OTP();
      instance.setuserid(userid);
      instance.setempid(empid);
      String otp_pwd = generateOTP();
      instance.setotp(otp_pwd);
      java.util.Date date = new java.util.Date();
      java.sql.Timestamp param = new java.sql.Timestamp(date.getTime());
      instance.settime(param);
      //automatically check if we have matching userid & empid (logic is in OTPDaoImpl.java)
      otpBO.save(instance);
     
      this.sendEmail(email, username, instance.getotp());
     
       return "OPTCreationSucess";
            
    }else{
      if(ea != null)
View Full Code Here

 
  @RequestMapping(value="/FirstTime", method = RequestMethod.GET)
  public synchronized ModelAndView firstTime(ModelMap model) {
   
    return new ModelAndView("FirstTime","otp", new OTP());
  }
View Full Code Here

    }else{
      //external use case
      userid = ea.getUserid();
      empid = 0;   
    }
    OTP indatabase = otpBO.findAccountByName(userid,empid);
   
    //suppose user provided valid one-time-password
     
        java.util.Date current_date = new java.util.Date();
        java.sql.Timestamp current_timestamp = new java.sql.Timestamp(current_date.getTime());
        long current_time = current_timestamp.getTime();
        long db_time = indatabase.gettime().getTime();
        long time_diff = current_time - db_time; //5 minutes = 5 * 60 * 1000 (ms) =300,000
        // Need to be modified!!!
        if(oneTimePassword.equals(indatabase.getotp()) && time_diff < 300000){
          System.out.println("Ok!!!");
         
          // delete the one time login entry
          otpBO.delete(indatabase);
          //set first time login to false
View Full Code Here

TOP

Related Classes of edu.asu.securebanking.model.OTP

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.