Esempio n. 1
0
        private bool CheckUploadAuthentication(out string error)
        {
            error = string.Empty;

            if (!CheckCredentialsEntered())
            {
                return(false);
            }

            var action = new CallHomeAuthenticationAction(pool, textBoxMyCitrixUsername.Text.Trim(), textBoxMyCitrixPassword.Text.Trim(),
                                                          Registry.CallHomeIdentityTokenDomainName, Registry.CallHomeUploadGrantTokenDomainName, Registry.CallHomeUploadTokenDomainName,
                                                          Registry.CallHomeProductKey, true, 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
            authenticated       = !string.IsNullOrEmpty(authenticationToken);
            authenticationToken = pool.CallHomeSettings.GetExistingSecretyInfo(pool.Connection, CallHomeSettings.UPLOAD_TOKEN_SECRET);
            return(authenticated);
        }
Esempio n. 2
0
        private bool CheckUploadAuthentication(out string error)
        {
            error = string.Empty;

            if (!uploadCheckBox.Checked)
            {
                return(true);
            }

            if (string.IsNullOrEmpty(usernameTextBox.Text) || string.IsNullOrEmpty(passwordTextBox.Text))
            {
                return(false);
            }

            var action = new CallHomeAuthenticationAction(null, usernameTextBox.Text.Trim(), passwordTextBox.Text.Trim(),
                                                          Registry.CallHomeIdentityTokenDomainName, Registry.CallHomeUploadGrantTokenDomainName, Registry.CallHomeUploadTokenDomainName,
                                                          false, TokenExpiration, false);

            try
            {
                action.RunExternal(null);
            }
            catch
            {
                error       = action.Exception != null ? action.Exception.Message : Messages.ERROR_UNKNOWN;
                UploadToken = null;
                return(false);
            }

            UploadToken = action.UploadToken;  // curent upload token
            return(!string.IsNullOrEmpty(UploadToken));
        }
Esempio n. 3
0
        private bool CheckUploadAuthentication(out string error)
        {
            error = string.Empty;

            if (!uploadCheckBox.Checked)
            {
                return(true);
            }

            if (string.IsNullOrEmpty(usernameTextBox.Text) || string.IsNullOrEmpty(passwordTextBox.Text))
            {
                return(false);
            }

            var action = new CallHomeAuthenticationAction(null, usernameTextBox.Text.Trim(), passwordTextBox.Text.Trim(),
                                                          Registry.CallHomeIdentityTokenDomainName, Registry.CallHomeUploadGrantTokenDomainName,
                                                          Registry.CallHomeUploadTokenDomainName, Registry.CallHomeProductKey,
                                                          false, TokenExpiration, false);

            new ActionProgressDialog(action, ProgressBarStyle.Blocks).ShowDialog(Parent);

            if (!action.Succeeded)
            {
                error       = action.Exception != null ? action.Exception.Message : Messages.ERROR_UNKNOWN;
                UploadToken = null;
                return(false);
            }

            UploadToken = action.UploadToken;  // curent upload token
            return(!string.IsNullOrEmpty(UploadToken));
        }
        private void authenticateButton_Click(object sender, EventArgs e)
        {
            HideAuthenticationStatusControls();

            spinnerIcon.StartSpinning();

            var action = new CallHomeAuthenticationAction(Pool, usernameTextBox.Text.Trim(), passwordTextBox.Text.Trim(),
                                                          Registry.CallHomeIdentityTokenDomainName, Registry.CallHomeUploadGrantTokenDomainName, Registry.CallHomeUploadTokenDomainName,
                                                          true, 0, false);

            action.Completed          += CallHomeAuthenticationAction_Completed;
            authenticateButton.Enabled = false;
            action.RunAsync();
        }