Sorry for the confusion - I was not suggesting to use TerminalControl
(doing so would not be practical at all for a web application), I was just trying to explain how to achieve a PuTTY-like behavior with Rebex Terminal Emulation (and PuTTY is a Windows application).
Also, I have not realized you were actually using the proof-of-concept WebTerminal
sample application.
In case of WebTerminal
sample app, I see two possible ways of achieving your goal:
A) Modify TerminalEndPoint so that useName/password in the Connect method are optional. If they are not specified, instead of Bind(_session)
, do Bind(new LoginChannelFactory(_session))
, where LoginChannelFactory
would be a custom implementaion of IShellChannelFactory
that simulates a telnet-like "server" (a custom instance of ShellChannel
) that asks for username and password and tries authenticating to the supplied _session
object. Once the authentication was successful, the custom instance of ShellChannel
would pass all calls to Ssh
object's `ShellChannel'.
B) Modify TerminalEndPoint so that there are separate Connect
and Login
method. When SSH is in selected with no username/password, just call Connect
and implement the username/password code in client-side JavaScript
. Once the code has the username/password, call Login
method, which would do the actual Bind
.
The first approach is more complicated, but it would actually work with both VirtualTerminal
and TerminalControl
, making it possible to implement PuTTY-like authentication both in WebTerminal sample and Windows applications. We will try giving this a try when we are back at the office in 2015!