public ActionResult TESTSUBMIT(RegisterNewDeviceViewModel model) { model = model ?? new RegisterNewDeviceViewModel(); if (!String.IsNullOrEmpty(model.RawRegisterResponse)) { var u2f = new FidoUniversalTwoFactor(); var challenge = model.Challenge; var startedRegistration = GetFidoRepository().GetStartedRegistration(GetCurrentUser(), challenge); var deviceRegistration = u2f.FinishRegistration(startedRegistration, model.RawRegisterResponse, GetTrustedDomains()); GetFidoRepository().StoreDeviceRegistration(GetCurrentUser(), deviceRegistration); GetFidoRepository().RemoveStartedRegistration(GetCurrentUser(), model.Challenge); } return(RedirectToAction("Registred")); }
public ActionResult TESTREG() { var u2f = new FidoUniversalTwoFactor(); var appId = new FidoAppId(Request.Url); var startedRegistration = u2f.StartRegistration(appId); GetFidoRepository().StoreStartedRegistration(GetCurrentUser(), startedRegistration); var model = new RegisterNewDeviceViewModel { AppId = startedRegistration.AppId.ToString(), Challenge = startedRegistration.Challenge, UserName = GetCurrentUser() }; return(View(model)); }
public ActionResult Register(NewUserViewModel newUserModel) { var u2f = new FidoUniversalTwoFactor(); var appId = new FidoAppId(Request.Url); var startedRegistration = u2f.StartRegistration(appId); GetFidoRepository().StoreStartedRegistration(newUserModel.UserName, startedRegistration); var model = new RegisterNewDeviceViewModel { AppId = startedRegistration.AppId.ToString(), Challenge = startedRegistration.Challenge, UserName = newUserModel.UserName, Email = newUserModel.Email }; return(View(model)); }