Add custom attribute tokens with tokenFilter
@@ -36,6 +36,7 @@ import org.apache.guacamole.auth.ldap.EscapingService;
import org.apache.guacamole.GuacamoleException;
import org.apache.guacamole.GuacamoleServerException;
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.simple.SimpleConnection;
import org.apache.guacamole.protocol.GuacamoleConfiguration;
@@ -126,6 +127,10 @@ public class ConnectionService {
TokenFilter tokenFilter = new TokenFilter();
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
Map<String, Connection> connections = new HashMap<String, Connection>();
while (results.hasMore()) {
@@ -295,4 +300,3 @@ public class ConnectionService {
}
}
-
