GUACAMOLE-5: Provide most recent Credentials to updateUserContext(). Doing otherwise relies on the AuthenticatedUser being updated, which is not guaranteed to happen.

This commit is contained in:
Michael Jumper
2016-07-29 15:14:39 -07:00
parent 872aac375c
commit abbc83a15b
6 changed files with 23 additions and 11 deletions

View File

@@ -130,6 +130,11 @@ public interface AuthenticationProvider {
* this AuthenticationProvider or any other installed
* AuthenticationProvider.
*
* @param credentials
* The credentials which were most recently submitted. These are not
* guaranteed to be the same as the credentials associated with the
* AuthenticatedUser when they originally authenticated.
*
* @return
* An updated UserContext describing the permissions, connection,
* connection groups, etc. accessible or associated with the given
@@ -140,6 +145,7 @@ public interface AuthenticationProvider {
* If an error occurs while updating the UserContext.
*/
UserContext updateUserContext(UserContext context,
AuthenticatedUser authenticatedUser) throws GuacamoleException;
AuthenticatedUser authenticatedUser,
Credentials credentials) throws GuacamoleException;
}

View File

@@ -251,7 +251,8 @@ public abstract class SimpleAuthenticationProvider
@Override
public UserContext updateUserContext(UserContext context,
AuthenticatedUser authorizedUser) throws GuacamoleException {
AuthenticatedUser authorizedUser, Credentials credentials)
throws GuacamoleException {
// Simply return the given context, updating nothing
return context;