Hi Nick,

Thanks for your reply.  But I'm confused -- in
updateAuthenticatedUser(AuthenticatedUser, Credentials), how can I get the
current UserContext object associated with that auth user?
SimpleAuthenticatedUser is a private class in SimpleAuthenticationProvider,
otherwise I could cast it and .getAuthorizedConfigurations()...

Does this imply that I also have to override authenticateUser() to return
some different kind of AuthenticatedUser that isn't private, or something?

Apologies for the naive questions, I'm new to guac and it's been a good 20
years since I've programmed in Java...

thanks,
--dustin

https://github.com/apache/guacamole-client/blob/master/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/simple/SimpleAuthenticationProvider.java#L68




On Mon, Nov 1, 2021 at 5:48 PM Nick Couchman <[email protected]> wrote:

> On Mon, Nov 1, 2021 at 5:15 PM Dustin Lang <[email protected]> wrote:
>
>> Hi,
>>
>> I'm trying to set up guacamole so that users on my large multi-user
>> server can start up their own VNC sessions (eg, via an SSH session).  On
>> the user's home page, I want to list all their currently existing VNC
>> sessions.
>>
>> I have adapted the PAMAuthenticationProvider (subclass of
>> SimpleAuthenticationProvider) to do this real-time check for the user's VNC
>> sessions, by overriding getAuthorizedConfigurations(), and also overriding
>> updateAuthenticatedUser() to re-generate that list when the user reloads
>> their home page.
>>
>> BUT, I'm finding that even though I am returning a new AuthenticatedUser
>> with a new set of available connections, the All Connections list on their
>> home page is not updating.
>>
>> Do I need to go in and adjust the existing AuthenticatedUser?, or is
>> there some other method I should be overriding instead?  Or is it not
>> possible to update the list of available connections after login?
>>
>>
> It's definitely possible to do - the JDBC module makes use of this, as you
> can add connections and then go back to the home screen and immediately see
> them.
>
> In the SimpleAuthenticationProvider module, there are a couple of places
> where configs are pulled - one of them is in the getUserContext() method:
>
> https://github.com/apache/guacamole-client/blob/62b26fb594aa160478ce44c6d2bb8e6a1cef4174/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/simple/SimpleAuthenticationProvider.java#L157-L172
>
> This calls the getAuthorizedConfigurations() method, so it's possible it
> explains why it's being initially populated correctly, but not updating.
> You may need to update the configurations inside the UserContext that is
> created as part of that getUserContext method.
>
> -Nick
>

Reply via email to