public static string GetRublonConsumerScript() { var rublon = new Rublon2Factor(Globals.SystemToken, Globals.SecretKey); var gui = new Rublon2FactorGUI(rublon); var script = new ConsumerScript(gui); return script.ToString(); }
public ActionResult BeginConfirm(TransactionConfirmationModel model) { if (model.Amount <= 0) { ModelState.AddModelError("Amount", "The field Amount must be greater than zero"); } else { try { var rublon = new Rublon2Factor(Globals.SystemToken, Globals.SecretKey); var message = string.Format("Do you confirm transaction no. {0} with the amount of {1:C}?", model.TransactionID, model.Amount); var parameters = new JObject(); parameters.Add("transId", model.TransactionID); var url = rublon.Confirm(Globals.Host + "/Callback/TransactionConfirm", User.Identity.Name, User.Identity.Name, message, parameters); if (!string.IsNullOrEmpty(url)) { return Redirect(url); } } catch (Exception) { ModelState.AddModelError("", "Transaction confirm failed"); } } return View("ConfirmTransaction"); }
protected void Page_Load(object sender, EventArgs e) { var rublon = new Rublon2Factor(Globals.SystemToken, Globals.SecretKey); var gui = new Rublon2FactorGUI(rublon); var user = Membership.GetUser(User.Identity.Name); gui.UserEmail = user.Email; gui.UserId = User.Identity.Name; lbWidgetHtml.Text = gui.ToString(); }
protected void Page_Load(object sender, EventArgs e) { var rublon = new Rublon2Factor(Globals.SystemToken, Globals.SecretKey); var client = new GetAvailableFeatures(rublon); client.Perform(); var features = client.GetFeatures(); lbForceMobileApp.Text = features.Value<bool>(GetAvailableFeatures.FEATURE_FORCE_MOBILE_APP) ? "<b>Active</b>" : "Not active"; lbIgnoreTrustedDevice.Text = features.Value<bool>(GetAvailableFeatures.FEATURE_IGNORE_TRUSTED_DEVICE) ? "<b>Active</b>" : "Not active"; lbOperationConfirmation.Text = features.Value<bool>(GetAvailableFeatures.FEATURE_OPERATION_CONFIRMATION) ? "<b>Active</b>" : "Not active"; lbBufferedConfirmation.Text = features.Value<bool>(GetAvailableFeatures.FEATURE_BUFFERED_CONFIRMATION) ? "<b>Active</b>" : "Not active"; lbIdentityProviding.Text = features.Value<bool>(GetAvailableFeatures.FEATURE_IDENTITY_PROVIDING) ? "<b>Active</b>" : "Not active"; lbRemoteLogout.Text = features.Value<bool>(GetAvailableFeatures.FEATURE_REMOTE_LOGOUT) ? "<b>Active</b>" : "Not active"; lbBussinessEdition.Text = features.Value<bool>(GetAvailableFeatures.FEATURE_BUSINNESS_EDITION) ? "<b>Active</b>" : "Not active"; }
public ActionResult ActiveFeatures() { var rublon = new Rublon2Factor(Globals.SystemToken, Globals.SecretKey); var client = new GetAvailableFeatures(rublon); client.Perform(); var features = client.GetFeatures(); ViewBag.ForceMobileApp = features.Value<bool>(GetAvailableFeatures.FEATURE_FORCE_MOBILE_APP); ViewBag.IgnoreTrustedDevice = features.Value<bool>(GetAvailableFeatures.FEATURE_IGNORE_TRUSTED_DEVICE); ViewBag.OperationConfirmation = features.Value<bool>(GetAvailableFeatures.FEATURE_OPERATION_CONFIRMATION); ViewBag.BufferedConfirmation = features.Value<bool>(GetAvailableFeatures.FEATURE_BUFFERED_CONFIRMATION); ViewBag.IdentityProviding = features.Value<bool>(GetAvailableFeatures.FEATURE_IDENTITY_PROVIDING); ViewBag.RemoteLogout = features.Value<bool>(GetAvailableFeatures.FEATURE_REMOTE_LOGOUT); ViewBag.BussinesEdition = features.Value<bool>(GetAvailableFeatures.FEATURE_BUSINNESS_EDITION); return View(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { hiddenTransactionId.Value = new Random().Next().ToString(); lbTransactionId.Text = hiddenTransactionId.Value; } else { try { var amount = decimal.Parse(tbAmount.Text); if (amount <= 0) { validatorAmountValue.IsValid = false; } else { try { var rublon = new Rublon2Factor(Globals.SystemToken, Globals.SecretKey); var message = string.Format("Do you confirm transaction no. {0} with the amount of {1:C}?", hiddenTransactionId.Value, amount); var parameters = new JObject(); parameters.Add("transId", hiddenTransactionId.Value); var user = Membership.GetUser(User.Identity.Name); var url = rublon.Confirm("http://localhost:53637/Callback/ConfirmTransaction", User.Identity.Name, user.Email, message, parameters); if (!string.IsNullOrEmpty(url)) { Response.Redirect(url); } } catch (Exception) { } } } catch(Exception) { validatorAmountType.IsValid = false; } } }
public Callback2Factor(Rublon2Factor rublon) : base(rublon) { }
public CallbackTransactionConfirm(Rublon2Factor rublon) : base(rublon) { this.rublon = rublon; }
private string loginPostListener(LoginModel model) { try { var rublon = new Rublon2Factor(Globals.SystemToken, Globals.SecretKey); rublon.Language = "en"; var url = rublon.Authorize(Globals.Host + "/Callback/Login/", model.UserName, model.UserName); if (!string.IsNullOrEmpty(url)) { WebSecurity.Logout(); Session["login_user"] = model.UserName; Session["login_pwd"] = model.Password; return url; } } catch (Exception) { WebSecurity.Logout(); throw; } return string.Empty; }
// GET: /Callback/TransactionConfirm public void TransactionConfirm() { var rublon = new Rublon2Factor(Globals.SystemToken, Globals.SecretKey); var callback = new CallbackTransactionConfirm(rublon); callback.Call(); }
// GET: /Callback/Login public void Login() { var rublon = new Rublon2Factor(Globals.SystemToken, Globals.SecretKey); var callback = new Callback2Factor(rublon); callback.Call(); }
protected void Page_Load(object sender, EventArgs e) { var rublon = new Rublon2Factor(Globals.SystemToken, Globals.SecretKey); var callback = new Callback2Factor(rublon); callback.Call(); }
/// <summary> /// Construct the API method instance. /// </summary> /// <param name="rublon">Rublon instance.</param> /// <param name="profileId">Profile ID to check.</param> /// <param name="deviceId">Device ID to check.</param> public CheckUserDevice(Rublon2Factor rublon, int profileId, int deviceId) : base(rublon) { this.profileId = profileId; this.deviceId = deviceId; }
/// <summary> /// Constructor. /// </summary> /// <param name="rublon">Rublon instance.</param> public Rublon2FactorCallback(Rublon2Factor rublon) : base(rublon) { this.rublon = rublon; }
public ActionResult Widgets() { var rublon = new Rublon2Factor(Globals.SystemToken, Globals.SecretKey); var gui = new Rublon2FactorGUI(rublon); gui.UserEmail = User.Identity.Name; gui.UserId = User.Identity.Name; ViewBag.GuiScript = gui.ToString(); return View(); }