You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@guacamole.apache.org by Tom Eaton <to...@htil.net> on 2025/06/05 14:12:44 UTC

Ephemeral connections

Hello all,

I’ve been testing the JSON auth extension, and successfully created a URL that logs in the user and connects to the link described in the JSON.

However, what I’m trying to achieve is that the link given to the user works for a short period, and any new links generated will take them to a new connection.

Each JSON string has one connection in it to allow guacamole to load it immediately without going to a list of available machines.

For example:

Link 1 - JSON - connection to server 1.
Link 2 - JSON - connection to server 2.

However, Guacamole remembers the user session from the initial link and ignores the connection details in the new link.  Is there a way to override this behaviour so that whatever link the user clicks on it will take them to that specific connection?

Thanks,

Tom E
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@guacamole.apache.org
For additional commands, e-mail: user-help@guacamole.apache.org


Re: Ephemeral connections

Posted by Nick Couchman <vn...@apache.org>.
On Thu, Jun 5, 2025 at 4:30 PM Tom Eaton <to...@htil.net> wrote:

> Hi Nick,
>
> Yes, I’ve got an expires in the JSON, however in this use case the user is
> likely to click on one link then the other in short succession, opening
> both connections in seperate tabs.  I am assuming this will end up in a
> race condition if the expires time is short lived but not short enough for
> it to expire.
>
> Tom
>
>
>
Got it - I wondered if that were the case, but figured I'd try the easy
stuff, first :-).

The only option I can think of for you to try, here, would be to
"randomize" the username that is sent to Guacamole such that no link ever
generates the same username. If you did that, and only delivered a single
connection per JSON authentication link, you could have Guacamole log in
and automatically start the connection, and each time the user clicked on a
link they'd get a new username, new login, etc.

Others on the list may have some other ideas.

-Nick

>

Re: Ephemeral connections

Posted by Tom Eaton <to...@htil.net>.
Hi Nick,

  

Yes, I’ve got an expires in the JSON, however in this use case the user is
likely to click on one link then the other in short succession, opening both
connections in seperate tabs.  I am assuming this will end up in a race
condition if the expires time is short lived but not short enough for it to
expire.

  

Tom

  

  

  

> On 5 Jun 2025, at 15:36, Nick Couchman <vn...@apache.org> wrote:  
>  
>

> 
>
> On Thu, Jun 5, 2025 at 10:14 AM Tom Eaton
> <[tom@htil.net](mailto:tom@htil.net)> wrote:
>

>> Hello all,  
>  
>  I’ve been testing the JSON auth extension, and successfully created a URL
> that logs in the user and connects to the link described in the JSON.  
>  
>  However, what I’m trying to achieve is that the link given to the user
> works for a short period, and any new links generated will take them to a
> new connection.  
>  
>  Each JSON string has one connection in it to allow guacamole to load it
> immediately without going to a list of available machines.  
>  
>  For example:  
>  
>  Link 1 - JSON - connection to server 1.  
>  Link 2 - JSON - connection to server 2.  
>  
>  However, Guacamole remembers the user session from the initial link and
> ignores the connection details in the new link.  Is there a way to override
> this behaviour so that whatever link the user clicks on it will take them to
> that specific connection?  
>  
>
>
>  
>
>
> Are you using the "expires" field in the JSON extension? I'm not sure that
> this will achieve exactly what you want, but it is a way to make sure that
> the JSON URLs only work for a certain amount of time. See:
>
>  
>
>
> <https://guacamole.apache.org/doc/gug/json-auth.html#json-format>
>
>  
>
>
> -Nick


Re: Ephemeral connections

Posted by Nick Couchman <vn...@apache.org>.
On Thu, Jun 5, 2025 at 10:14 AM Tom Eaton <to...@htil.net> wrote:

> Hello all,
>
> I’ve been testing the JSON auth extension, and successfully created a URL
> that logs in the user and connects to the link described in the JSON.
>
> However, what I’m trying to achieve is that the link given to the user
> works for a short period, and any new links generated will take them to a
> new connection.
>
> Each JSON string has one connection in it to allow guacamole to load it
> immediately without going to a list of available machines.
>
> For example:
>
> Link 1 - JSON - connection to server 1.
> Link 2 - JSON - connection to server 2.
>
> However, Guacamole remembers the user session from the initial link and
> ignores the connection details in the new link.  Is there a way to override
> this behaviour so that whatever link the user clicks on it will take them
> to that specific connection?
>
>
Are you using the "expires" field in the JSON extension? I'm not sure that
this will achieve exactly what you want, but it is a way to make sure that
the JSON URLs only work for a certain amount of time. See:

https://guacamole.apache.org/doc/gug/json-auth.html#json-format

-Nick