public Outcome Execute() { Outcome response = new Outcome(); SSORegistrationResponseDTO dto = new SSORegistrationResponseDTO(); dto.Messages = new List <string>(); SSORegDTO gatewayDTO = new SSORegDTO() { username = incommingCredentials.username, password = incommingCredentials.password, salt = incommingCredentials.salt }; SSORegistrationGateway gateway = new SSORegistrationGateway(); var gatewayResponse = gateway.SSORegistration(gatewayDTO); if (gatewayResponse.isSuccessful == false) { dto.isSuccessful = false; dto.Messages.Add("Faild to add User"); response.Result = dto; return(response); } dto.isSuccessful = true; dto.password = ""; dto.username = ""; dto.Messages.Add("Success"); response.Result = dto; return(response); }
public SSORegistrationResponseDTO SSORegistrationService() { SSORegistrationResponseDTO response = new SSORegistrationResponseDTO(); response.Messages = new List <string>(); SSOGetCredentials getSSOCredentials = new SSOGetCredentials() { ssoregresponse = response }; var creds = (SSORegistrationResponseDTO)getSSOCredentials.Execute().Result; if (creds.isSuccessful == false || string.IsNullOrEmpty(creds.username) || string.IsNullOrEmpty(creds.password)) { return(creds); } SSOStoreCredentials addUser = new SSOStoreCredentials() { incommingCredentials = creds }; var useradded = (SSORegistrationResponseDTO)addUser.Execute().Result; if (useradded.isSuccessful == false) { response.isSuccessful = false; response.Messages.Add("Failed"); return(response); } response.isSuccessful = true; response.Messages.Add("Success!"); return(response); }