public async Task <LoginRequestResponse> Login(string email, string password) { //for (int i = 0; i < 5; i++) //{ // await Task.Factory.StartNew(() => { // }); // await Task.Delay(1000); //} LoginRequestForCustomApp loginRequest = new LoginRequestForCustomApp(); loginRequest.CustomAppName = "ProjectInsight.WebApp"; loginRequest.EmailAddress = email; loginRequest.Password = password; PI_Client = new ProjectInsightWebApiClient(Common.WorkspaceApi); try { await Task.Factory.StartNew(() => { user = PI_Client.Authentication.LoginRequestForCustomApp(loginRequest); }); //user = await PI_Client.Authentication.LoginRequestForCustomAppAsync(loginRequest); //ProjectInsight.Models.Users.User userL = new ProjectInsight.Models.Users.User(); //userL.EmailAddress = email; //userL.UserName = email; //userL.Password = password; //user = await PI_Client.Authentication.LoginRequestForCustomAppAsync(userL); if (user.IsValid) { //PI_Client.Authentication.AddQueryParam("api-token", user.Token); authenticationClient = PI_Client.Authentication; authenticationClient.ProjectInsightWebApiClient.ApiToken = user.Token; //var sso = authenticationClient.GetLoginSettings(); //APIsInitialization.InitializeApis(Common.WorkspaceApi, user.Token); return(user); } } catch (Exception ex) { } return(null); }
void LoginResponseProcess(LoginRequestResponse Lr) { if (Lr.Logincode == LoginCode.LOGIN_SUCCESS) { MessageBox.Show("Giriş Başarılı"); MySokcets.SendUserInfoRequest(); this.Close(); } else { MessageBox.Show(LoginCode.PASSWORD_INCORRECT.ToString()); } }
public LoginRequestResponse LoginUser(LoginAccountRequest loginAccountRequest) { LoginRequestResponse loginRequestResponse = new LoginRequestResponse(); if (_authRepository.CustomerAccountExists(loginAccountRequest.Email, loginAccountRequest.Password)) { loginRequestResponse = CreateLoginResponse(loginAccountRequest, (int)HttpStatusCode.OK); } else { loginRequestResponse = CreateLoginResponse(loginAccountRequest, (int)HttpStatusCode.NotFound); } return(loginRequestResponse); }
public LoginRequestResponse CreateLoginResponse(string email, string password, int statusCode) { var loginResponse = new LoginRequestResponse(); loginResponse.StatusCode = statusCode; var foundAccount = _appDbContext.T_IBS_App_Accounts.FirstOrDefault(e => e.Email == email && e.Password == password); if (foundAccount != null) { var foundCustomerJoinAccount = _appDbContext.T_IBS_Join_Customers_App_Accounts.FirstOrDefault(id => id.Id_App_Account == foundAccount.Id_App_Account); var foundCustomer = _appDbContext.T_IBS_CUSTOMERS.FirstOrDefault(id => id.Id_Customer == foundCustomerJoinAccount.Id_Customer); loginResponse.CustomerId = foundCustomer.Id_Customer; loginResponse.FirstName = foundCustomer.First_Name; loginResponse.LastName = foundCustomer.Last_Name; loginResponse.CNP = foundCustomer.CNP; } return(loginResponse); }
void ProcessLoginResponse(LoginRequestResponse LR) { Console.WriteLine(LR.ToString() + "ddsds"); }