code: private Map<String, String> getAttributeTokens(LDAPConnection ldapConnection,
              String username) throws GuacamoleException {
  
          // Get attributes from configuration information
          List<String> attrList = confService.getAttributes();
  
          // If there are no attributes there is no reason to search LDAP
          if (attrList.isEmpty())
              return Collections.<String, String>emptyMap();
  
          // Build LDAP query parameters
          String[] attrArray = attrList.toArray(new String[attrList.size()]);
          String userDN = getUserBindDN(username);
  
          Map<String, String> tokens = new HashMap<String, String>();
          try {
  
              // Get LDAP attributes by querying LDAP
              LDAPEntry userEntry = ldapConnection.read(userDN, attrArray);
              if (userEntry == null)
                  return Collections.<String, String>emptyMap();
  
              LDAPAttributeSet attrSet = userEntry.getAttributeSet();
              if (attrSet == null)
                  return Collections.<String, String>emptyMap();
  
              // Convert each retrieved attribute into a corresponding token
              for (Object attrObj : attrSet) {
                  LDAPAttribute attr = (LDAPAttribute)attrObj;
                  tokens.put(TokenName.fromAttribute(attr.getName()), attr.getStringValue());
              }
  
          }
          catch (LDAPException e) {
              throw new GuacamoleServerException("Could not query LDAP user attributes.", e);
          }
  
          return tokens;
  
      }
docs: Returns parameter tokens generated from LDAP attributes on the user
  currently bound under the given LDAP connection. The attributes to be
  converted into parameter tokens must be explicitly listed in
  guacamole.properties. If no attributes are specified or none are
  found on the LDAP user object, an empty map is returned.
  
  @param ldapConnection
  LDAP connection to use to read the attributes of the user.
  
  @param username
  The username of the user whose attributes are to be queried.
  
  @return
  A map of parameter tokens generated from attributes on the user
  currently bound under the given LDAP connection, as a map of token
  name to corresponding value, or an empty map if no attributes are
  specified or none are found on the user object.
  
  @throws GuacamoleException
  If an error occurs retrieving the user DN or the attributes.