glyptodon/guacamole-client — pull request #2 by grncdr (2013-07-24 04:54:37+00:00)
Title: Allow authProvider to update/replace UserContext at request time

These changes were needed to enable my guacamole-auth-hmac plugin. The gist of what's going on here is that I've moved code that would've been skipped if there was a cached UserContext up so that it's always run. Then either authProvider.getUserContext or authProvider.updateUserContext is run, depending on whether a cached context is found.

One tricky bit is that `HttpServletRequest.getParameter` will read request bodies (breaking most POST requests). This means that guacamole can only safely set the username and password in the credentials object for requests to `tunnel?connect`. This is an (unfortunate) limitation of the Java servlet API. It would work for my purposes if updateUserContext was only called on requests to `tunnel?connect`, what do you think?