mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-10 07:01:21 +00:00
GUACAMOLE-524: Add custom attribute tokens with tokenFilter
This commit is contained in:
@@ -36,6 +36,7 @@ import org.apache.guacamole.auth.ldap.EscapingService;
|
|||||||
import org.apache.guacamole.GuacamoleException;
|
import org.apache.guacamole.GuacamoleException;
|
||||||
import org.apache.guacamole.GuacamoleServerException;
|
import org.apache.guacamole.GuacamoleServerException;
|
||||||
import org.apache.guacamole.net.auth.AuthenticatedUser;
|
import org.apache.guacamole.net.auth.AuthenticatedUser;
|
||||||
|
//import org.apache.guacamole.auth.ldap.user.AuthenticatedUser;
|
||||||
import org.apache.guacamole.net.auth.Connection;
|
import org.apache.guacamole.net.auth.Connection;
|
||||||
import org.apache.guacamole.net.auth.simple.SimpleConnection;
|
import org.apache.guacamole.net.auth.simple.SimpleConnection;
|
||||||
import org.apache.guacamole.protocol.GuacamoleConfiguration;
|
import org.apache.guacamole.protocol.GuacamoleConfiguration;
|
||||||
@@ -126,6 +127,10 @@ public class ConnectionService {
|
|||||||
TokenFilter tokenFilter = new TokenFilter();
|
TokenFilter tokenFilter = new TokenFilter();
|
||||||
StandardTokens.addStandardTokens(tokenFilter, user);
|
StandardTokens.addStandardTokens(tokenFilter, user);
|
||||||
|
|
||||||
|
// Add custom attribute tokens
|
||||||
|
Map<String, String> attrs = ( (org.apache.guacamole.auth.ldap.user.AuthenticatedUser) user).getAttributes();
|
||||||
|
StandardTokens.addAttributeTokens(tokenFilter, attrs);
|
||||||
|
|
||||||
// Produce connections for each readable configuration
|
// Produce connections for each readable configuration
|
||||||
Map<String, Connection> connections = new HashMap<String, Connection>();
|
Map<String, Connection> connections = new HashMap<String, Connection>();
|
||||||
while (results.hasMore()) {
|
while (results.hasMore()) {
|
||||||
@@ -295,4 +300,3 @@ public class ConnectionService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user