示例#1
0
 public ActionResult SecretKey(string id)
 {
     try
     {
         string secret = authAndPayService.GetSecretOfUser(id);
         string result = String.Format(@"00/{0}", secret);
         QRConverter converter = new QRConverter();
         BitMatrix bitMatrix = converter.GetQR(result);
         return new QRImageResult(bitMatrix);
     }
     catch
     {
         return new HttpStatusCodeResult(401);
     }
 }
示例#2
0
 public ActionResult AuthChallenge(string id,long time)
 {
     try
     {
         string secret = authAndPayService.GetAuthChallenge(id, time);
         string result = String.Format(@"01/{0}/{1}", time,secret);
         QRConverter converter = new QRConverter();
         BitMatrix bitMatrix = converter.GetQR(result);
         return new QRImageResult(bitMatrix);
     }
     catch
     {
         return new HttpStatusCodeResult(401);
     }
 }