protected void RequestPromptInfo(string[] subMethods)
        {
            // Raise event to get prompt info.
            var reqPromptInfoEventArgs = new PromptInfoRequestedEventArgs(subMethods);

            if (PromptInfoRequested != null)
            {
                PromptInfoRequested(this, reqPromptInfoEventArgs);
            }

            if (reqPromptInfoEventArgs.NoAuthRequired)
            {
                // Auth has succeeded.
                AuthenticateUser(_lastUserName);
            }
            if (reqPromptInfoEventArgs.Prompts != null)
            {
                // Send Info Request message.
                SendMsgUserAuthInfoRequest(reqPromptInfoEventArgs.Name, reqPromptInfoEventArgs.Instruction,
                                           reqPromptInfoEventArgs.Prompts);
            }
            else
            {
                // No prompts were provided.
                SendMsgUserAuthFailure(false);
            }
        }
        protected void RequestPromptInfo(string[] subMethods)
        {
            // Raise event to get prompt info.
            var reqPromptInfoEventArgs = new PromptInfoRequestedEventArgs(subMethods);

            if (PromptInfoRequested != null) PromptInfoRequested(this, reqPromptInfoEventArgs);

            if (reqPromptInfoEventArgs.NoAuthRequired)
            {
                // Auth has succeeded.
                AuthenticateUser(_lastUserName);
            }
            if (reqPromptInfoEventArgs.Prompts != null)
            {
                // Send Info Request message.
                SendMsgUserAuthInfoRequest(reqPromptInfoEventArgs.Name, reqPromptInfoEventArgs.Instruction,
                    reqPromptInfoEventArgs.Prompts);
            }
            else
            {
                // No prompts were provided.
                SendMsgUserAuthFailure(false);
            }
        }
        private void authService_PromptInfoRequested(object sender, PromptInfoRequestedEventArgs e)
        {
            var authService = (SshAuthenticationService)sender;

            e.Name = "Custom Authentication Method";
            e.Instruction = "Enter your password.";
            e.Prompts = new[] { new AuthenticationPrompt("Password: "******"Prompt info request sent.", EventLogEntryType.Information);
        }