On Wed, Dec 13, 2017 at 9:59 AM, genesis <[email protected]> wrote:

> Hi Carl, I see.
> And what do you do with this cookie on the getAuthorizedConfiguration
> method? Do you decrypt it and map to a Map<String, GuacamoleConfiguration>
> object?
>
> My doubt is, how do you update the configs list when the user opens another
> tab, with another GuacamoleConfiguration on cookie? You must insert this
> new
> configuration in the configs object. One for the first url and one for the
> second url, to have multiple connections at the same time.
>
>
If the data available for the user will be changing with updated
credentials, you will need to avoid the SimpleAuthenticationProvider class
and instead implement AuthenticationProvider directly. The
AuthenticationProvider interface provides two functions for producing the
object representing the data available to the user:

1) getUserContext() - invoked upon successful authentication at the
beginning of the user's session
2) updateUserContext() - invoked for new requests within an existing
session, to allow for updating the UserContext based on new credentials

You can leverage these to continuously update the data available to the
user.

I would also recommend looking into using the ANONYMOUS_IDENTIFIER for the
AuthenticatedUser:

http://guacamole.apache.org/doc/guacamole-ext/org/apache/guacamole/net/auth/AuthenticatedUser.html#ANONYMOUS_IDENTIFIER

An anonymous user has different semantics and is given a slightly different
interface. The menu which contains user-specific options in the upper-right
of most Guacamole screens is no longer shown, and the user's session is not
persisted. A successful authentication attempt for an anonymous user in one
tab will have no influence on tabs opened later; outside that tab, it will
be as if the user is not logged in at all, with each new tab getting its
own session. In this case, you wouldn't need to worry about updating the
UserContext at all, and would just need to be sure to provide the correct
data given a particular set of credentials.

- Mike

Reply via email to