It took a lot of reading and re-reading of old posts in various places but I 
finally figured out what I needed. I'm going to answer my own questions here to 
bring together all the info I gathered. One, the shared link is created in the 
web client through javascript. Second, there's no direct way to create the 
shared link through Java. In my case, since I'm not using the included web 
client, the shared url wouldn't work for me anyway. What I ended up doing was, 
in the servlet I grab the connection id when a user connects and store it in a 
database. Then to share a connection, I pass the connection id to the servlet 
which uses it when setting up the new connection (using the 
GuacamoleConfiguration object).

A couple of notes:

I'm using Guac 1.0. One frustrating thing I found when researching, was posts 
that didn't specify the version. Only later would I discover that some piece of 
info didn't apply to my version.

In the servlet code from the tutorial there is this:
GuacamoleSocket socket = new ConfiguredGuacamoleSocket
Which I changed to:
              ConfiguredGuacamoleSocket socket = new ConfiguredGuacamoleSocket
Because GuacamoleSocket doesn't have getConnectionID()


You can set the  connection to be readonly by setting this:
              config.setParameter("read-only", String.valueOf(Boolean.TRUE));
(Where config is a GuacamoleConfiguration object.)


The connection ID is created when the tunnel is created, so I get it right 
before I return the tunnel.


I think that's everything. Hopefully this will be helpful to someone.

Scott


From: Scott Hancock <[email protected]>
Sent: Wednesday, May 6, 2020 9:40 AM
To: [email protected]
Subject: RE: Shared Connection URL

So maybe the better question is where in the codebase is the code that creates 
the shared connection url?

Thanks,
Scott

From: Scott Hancock <[email protected]<mailto:[email protected]>>
Sent: Tuesday, May 5, 2020 5:12 PM
To: [email protected]<mailto:[email protected]>
Subject: Re: Shared Connection URL

Hi Mike,

I inherited this code and I don't know what the reasons are. Yes, we have our 
own web application. It looks like it's based on the tutorial code.

Scott
________________________________
From: Mike Jumper <[email protected]<mailto:[email protected]>>
Sent: Tuesday, May 5, 2020 4:02 PM
To: [email protected]<mailto:[email protected]> 
<[email protected]<mailto:[email protected]>>
Subject: Re: Shared Connection URL

On Tue, May 5, 2020 at 1:56 PM Scott Hancock 
<[email protected]<mailto:[email protected]>> wrote:

I'm new to Guacamole and I need to get a shared connection URL for every new 
connection. For reasons, we don't have the REST API available.

What reasons? If using the mainline web application, the web application as a 
whole would not be functional without its REST API. It is the REST API that 
drives the interface of the web application.


In Guacamole 1.0, how do I generate the shared connection url using the Java 
api?

Does this mean you have your own web application, built against 
guacamole-common and guacamole-common-js?

- Mike

Reply via email to