mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUAC-340: Filter all configurations returned by getAuthorizedConfigurations() in SimpleAuthenticationProvider.
This commit is contained in:
@@ -28,6 +28,8 @@ import org.glyptodon.guacamole.net.auth.AuthenticationProvider;
|
|||||||
import org.glyptodon.guacamole.net.auth.Credentials;
|
import org.glyptodon.guacamole.net.auth.Credentials;
|
||||||
import org.glyptodon.guacamole.net.auth.UserContext;
|
import org.glyptodon.guacamole.net.auth.UserContext;
|
||||||
import org.glyptodon.guacamole.protocol.GuacamoleConfiguration;
|
import org.glyptodon.guacamole.protocol.GuacamoleConfiguration;
|
||||||
|
import org.glyptodon.guacamole.token.StandardTokens;
|
||||||
|
import org.glyptodon.guacamole.token.TokenFilter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides means of retrieving a set of named GuacamoleConfigurations for a
|
* Provides means of retrieving a set of named GuacamoleConfigurations for a
|
||||||
@@ -72,6 +74,14 @@ public abstract class SimpleAuthenticationProvider
|
|||||||
if (configs == null)
|
if (configs == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
// Build credential TokenFilter
|
||||||
|
TokenFilter tokenFilter = new TokenFilter();
|
||||||
|
StandardTokens.addStandardTokens(tokenFilter, credentials);
|
||||||
|
|
||||||
|
// Filter each configuration
|
||||||
|
for (GuacamoleConfiguration config : configs.values())
|
||||||
|
tokenFilter.filterValues(config.getParameters());
|
||||||
|
|
||||||
// Return user context restricted to authorized configs
|
// Return user context restricted to authorized configs
|
||||||
return new SimpleUserContext(credentials.getUsername(), configs);
|
return new SimpleUserContext(credentials.getUsername(), configs);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user