public HttpResponseMessage Authentificate(HttpRequestMessage request, [FromBody] CredentialsData viewModel) { return(CreateHttpResponse(request, () => { HttpResponseMessage response = null; if (_oktaProvider.ValidateUser(viewModel.Email, viewModel.Password)) { try { var principal = Thread.CurrentPrincipal as EzePrincipal; if (principal != null) { var userData = new SimpleUserData(principal.UserId, principal.Login, principal.Identity.Name, principal.CompanyId, principal.MemeberName); response = request.CreateResponse(HttpStatusCode.OK, new { userData = userData, loginSuccess = true }); } } catch (Exception ex) { response = request.CreateResponse(HttpStatusCode.OK, new { loginSuccess = false, message = ex.Message }); } } else { response = request.CreateResponse(HttpStatusCode.OK, new { loginSuccess = false, message = HttpContext.Current.Items["authnError"] }); } return response; })); }
public static void set(string guid = null, string password = null) { credentials = new CredentialsData(guid, password); save(); onAccountChange(); }
public static void delete() { credentials = null; account = null; AccountData.onCurrencyChange(); File.Delete(location); onAccountChange(); }
public void LoginPageNeg2() { CredentialsData credentials = new CredentialsData(); Userid.SendKeys("pallavidubey0823gmail.com"); Password.SendKeys(""); SignIn.Click(); Thread.Sleep(5000); }
public void LoginPage() { CredentialsData credentials = new CredentialsData(); Userid.SendKeys(credentials.email); Password.SendKeys(credentials.password); SignIn.Click(); Thread.Sleep(5000); }
public static void load() { if (File.Exists(location)) { BinaryFormatter formatter = new BinaryFormatter(); FileStream stream = new FileStream(location, FileMode.Open); credentials = formatter.Deserialize(stream) as CredentialsData; stream.Close(); } else { credentials = null; Debug.Log("Account file not found in " + location); } onAccountChange(); }