Well, I'm taking my next stab, of who knows how many, at getting prompting
to work in Guacamole, but going the route that Mike suggested on the pull
request and using the protocol to request the parameters rather than
tokens.  I'm determined to do this :-).

I'm running into some challenges with this that I think may be related to
handling the usually-asynchronous nature of JavaScript and the connection
protocol, but needing to temporarily make the connection pause to wait for
the input.  I've implemented the protocol-level changes for this - I'd
appreciate some sanity check on my code, but those items were pretty easy.
See the following commits:

Server:
https://github.com/necouchman/guacamole-server/commit/c3bf085076344951621a0170b205d51e387f7cd6

Client:
https://github.com/necouchman/guacamole-client/commit/72de5595880baea46505cf4f9ad49640f16519e7

Easy enough - hopefully those look sane?  I've done a little more building
out for RDP connections, for both server and client.  On the server-side,
there's actually a callback function that is invoked by FreeRDP when
authentication fails.  I'm using this as a way to send the prompts back to
the client:

https://github.com/necouchman/guacamole-server/blob/cfe68a796eb58b1aaecf82bbd01fe49e685f3846/src/protocols/rdp/rdp.c#L445-L501

This seems to be working, fine - I see the prompt come through on the
client-side when implementing a simple GuacClient.onprompt() function that
just logs the request.  However, I don't think the connection is pausing
and waiting for the response - rather than getting a prompt on the client
side, I get a notification that the connection failed.  Relevant client
code is here:

https://github.com/necouchman/guacamole-client/blob/23c784e9d812ba3fd3ee0dd352f3b75e7f422381/guacamole/src/main/webapp/app/client/types/ManagedClient.js#L517-L581

Obviously the code is pretty rough right now, but any feedback would be
appreciated, on whether I'm headed the right direction or not, or what I
might need to do, either in this onprompt() method, or on the server-side
code, to pause the connection while I wait for the prompt.

The links to the branches I'm working out of are here - lots of extra
commits at the moment while I try things out, so excuse that mess...

https://github.com/necouchman/guacamole-server/tree/jira/221
https://github.com/necouchman/guacamole-client/tree/jira/221

Thanks - Nick

Reply via email to