code: private GuacamoleConfiguration getGuacamoleConfiguration(RemoteAuthenticatedUser user,
              ModeledConnection connection) {
  
          // Generate configuration from available data
          GuacamoleConfiguration config = new GuacamoleConfiguration();
  
          // Set protocol from connection
          ConnectionModel model = connection.getModel();
          config.setProtocol(model.getProtocol());
  
          // Set parameters from associated data
          Collection<ConnectionParameterModel> parameters = connectionParameterMapper.select(connection.getIdentifier());
          for (ConnectionParameterModel parameter : parameters)
              config.setParameter(parameter.getName(), parameter.getValue());
  
          return config;
          
      }
docs: Returns a guacamole configuration containing the protocol and parameters
  from the given connection. If tokens are used in the connection
  parameter values, credentials from the given user will be substituted
  appropriately.
  
  @param user
  The user whose credentials should be used if necessary.
  
  @param connection
  The connection whose protocol and parameters should be added to the
  returned configuration.
  
  @return
  A GuacamoleConfiguration containing the protocol and parameters from
  the given connection.