private bool CheckUploadAuthentication(out string error) { error = string.Empty; if (!CheckCredentialsEntered()) { return(false); } var action = new HealthCheckAuthenticationAction(textBoxMyCitrixUsername.Text.Trim(), textBoxMyCitrixPassword.Text.Trim(), Registry.HealthCheckIdentityTokenDomainName, Registry.HealthCheckUploadGrantTokenDomainName, Registry.HealthCheckUploadTokenDomainName, Registry.HealthCheckDiagnosticDomainName, Registry.HealthCheckProductKey, 0, false); try { action.RunExternal(null); } catch { error = action.Exception != null ? action.Exception.Message : Messages.ERROR_UNKNOWN; authenticationToken = null; authenticated = false; return(authenticated); } authenticationToken = action.UploadToken; // curent upload token diagnosticToken = action.DiagnosticToken; // curent diagnostic token authenticated = !String.IsNullOrEmpty(authenticationToken) && !String.IsNullOrEmpty(diagnosticToken); return(authenticated); }
private bool CheckUploadAuthentication(out string error) { error = string.Empty; if (!uploadCheckBox.Checked) { return(true); } if (string.IsNullOrEmpty(usernameTextBox.Text.Trim()) || string.IsNullOrEmpty(passwordTextBox.Text)) { return(false); } var action = new HealthCheckAuthenticationAction(usernameTextBox.Text.Trim(), passwordTextBox.Text.Trim(), Registry.HealthCheckIdentityTokenDomainName, Registry.HealthCheckUploadGrantTokenDomainName, Registry.HealthCheckUploadTokenDomainName, Registry.HealthCheckDiagnosticDomainName, Registry.HealthCheckProductKey, TokenExpiration, false); using (var dlg = new ActionProgressDialog(action, ProgressBarStyle.Blocks)) dlg.ShowDialog(Parent); if (!action.Succeeded) { error = action.Exception != null ? action.Exception.Message : Messages.ERROR_UNKNOWN; UploadToken = null; return(false); } UploadToken = action.UploadToken; // current upload token return(!string.IsNullOrEmpty(UploadToken)); }
private void CheckUploadAuthentication() { var action = new HealthCheckAuthenticationAction(textBoxMyCitrixUsername.Text.Trim(), textBoxMyCitrixPassword.Text.Trim(), Registry.HealthCheckIdentityTokenDomainName, Registry.HealthCheckUploadGrantTokenDomainName, Registry.HealthCheckUploadTokenDomainName, Registry.HealthCheckDiagnosticDomainName, Registry.HealthCheckProductKey, 0, true, true); action.Completed += action_Completed; okButton.Enabled = false; pictureBoxStatus.Image = Images.StaticImages.ajax_loader; labelStatus.Text = action.Description; labelStatus.ForeColor = SystemColors.ControlText; tableLayoutPanel5.Visible = true; action.RunAsync(); }