guacamole-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Couchman <vn...@apache.org>
Subject Re: Creating connections from external source
Date Thu, 25 Apr 2019 20:34:19 GMT
On Wed, Apr 24, 2019 at 8:15 AM raziel2244 <elliot@raziel.space> wrote:

> Hi I am in a situation where I have another webpage and I would like it to
> be
> able to open a connection through guacamole by passing a
> username,password,address etc over and open the connection in a new
> tab/window.
>
> I thought maybe the quickconnect function would help but I'm unsure about
> how to pass in the data I need for that to work in this way. Does anyone
> know how I can set this up?
>
> Annoyingly Java is in my way as I tried to look at modifying the angular
> module for quickconnect but don't know enough about Java and how it's using
> the Javascript files to be able to do it myself.
>
>
>
The AngularJS components are the web application that runs in the user's
browser.  These interface with the Java components via a REST interface.
The QuickConnect module uses a REST endpoint to create the connection and
then the user gets redirected to the created connection.  I would imagine
this would work for what you're trying to do, although it might be a bit
overkill.

The relevant lines for creating the connection are here:

https://github.com/apache/guacamole-client/blob/3c9f880cb080dc57003a2869996d3f00536f6374/extensions/guacamole-auth-quickconnect/src/main/resources/services/quickConnectService.js#L43-L66

Basically, this function does a POST of data to the
api/session/ext/quickconnect/create
endpoint, with the Guacamole token (from the current login) and then a
single form parameter, the URI of the connection you're creating.  It
returns the connection identifier, which can then be used to access the URL
for the connection.  The code for redirecting after the connection is
successfully created is here:

https://github.com/apache/guacamole-client/blob/3c9f880cb080dc57003a2869996d3f00536f6374/extensions/guacamole-auth-quickconnect/src/main/resources/controllers/quickconnectController.js#L44-L53

It's worth noting that utilizing this code shouldn't require any knowledge
or tinkering with the Java back-end - if you use this the same way that the
AngularJS portion of the QuickConnect extension does, then the back-end
implementation shouldn't be of any concern.

-Nick

Mime
View raw message