On Tue, Apr 11, 2017 at 9:42 AM, Paulo Gonçalves <[email protected]> wrote:
> > > Hello. > > I'm trying to build a extension that creates connections on demand, but > from what I can observe, the getUserContext of the > AuthenticationProvider is only called on user login. > > Correct. Same with authenticateUser(). > Is it possible to call this method after login? > Not getUserContext(), as that is strictly part of the initial authentication process for a newly-authenticated user. The functions you're looking for are updateAuthenticatedUser() and updateUserContext(): http://guacamole.incubator.apache.org/doc/guacamole-ext/org/apache/guacamole/net/auth/AuthenticationProvider.html#updateAuthenticatedUser-org.apache.guacamole.net.auth.AuthenticatedUser-org.apache.guacamole.net.auth.Credentials- http://guacamole.incubator.apache.org/doc/guacamole-ext/org/apache/guacamole/net/auth/AuthenticationProvider.html#updateUserContext-org.apache.guacamole.net.auth.UserContext-org.apache.guacamole.net.auth.AuthenticatedUser-org.apache.guacamole.net.auth.Credentials- Those functions will be invoked each time a page is visited for any authenticated user. You don't necessarily *need* to implement these functions, however. You are free to have your UserContext implementation update its own contents, and you don't need to wait for a page load to do so. The above update functions are really only needed if you need to make adjustments based on newly-received credentials, HTTP request parameters, etc. If your UserContext pulls its connections dynamically, the user should see those connections change when they reload the page. They will not see those connections, however: 1) If they do not reload the page (the connection tree is cached client-side) 2) If you're using SimpleAuthenticationProvider, SimpleUserContext, etc. (those classes cache their own contents) - Mike
