Add updateUserContext() function.

This commit is contained in:
Michael Jumper
2013-08-07 13:22:35 -07:00
parent 4550a73db1
commit 11bc2d7c68
3 changed files with 39 additions and 0 deletions

View File

@@ -179,4 +179,13 @@ public class MySQLAuthenticationProvider implements AuthenticationProvider {
);
} // end of constructor
@Override
public UserContext updateUserContext(UserContext context,
Credentials credentials) throws GuacamoleException {
// No need to update the context
return context;
}
}

View File

@@ -62,4 +62,25 @@ public interface AuthenticationProvider {
UserContext getUserContext(Credentials credentials)
throws GuacamoleException;
/**
* Returns a new or updated UserContext for the user authorized by the
* give credentials and having the given existing UserContext. Note that
* because this function will be called for all future requests after
* initial authentication, including tunnel requests, care must be taken
* to avoid using functions of HttpServletRequest which invalidate the
* entire request body, such as getParameter().
*
* @param context The existing UserContext belonging to the user in
* question.
* @param credentials The credentials to use to retrieve or update the
* environment.
* @return The updated UserContext, which need not be the same as the
* UserContext given, or null if the user is no longer authorized.
*
* @throws GuacamoleException If an error occurs while updating the
* UserContext.
*/
UserContext updateUserContext(UserContext context, Credentials credentials)
throws GuacamoleException;
}

View File

@@ -97,4 +97,13 @@ public abstract class SimpleAuthenticationProvider
}
@Override
public UserContext updateUserContext(UserContext context,
Credentials credentials) throws GuacamoleException {
// Simply return the given context, updating nothing
return context;
}
}