GUACAMOLE-524: Added reading of LDAP attributes in guacamole.properties named 'ldap-user-attributes'.

Added method getAttributes() in ConfigurationService to read environment property
LDAPGuacamoleProperties.LDAP_USER_ATTRIBUTES. These
attributes are arbitrary LDAP attributes that will
be mapped to the user in credentials and
tokens.
This commit is contained in:
Jared Frees
2018-06-08 12:30:15 -04:00
parent 0e856d7a21
commit 38eb97b422
2 changed files with 27 additions and 1 deletions

View File

@@ -227,7 +227,7 @@ public class ConfigurationService {
private int getMaxResults() throws GuacamoleException {
return environment.getProperty(
LDAPGuacamoleProperties.LDAP_MAX_SEARCH_RESULTS,
1000
1000
);
}
@@ -344,4 +344,20 @@ public class ConfigurationService {
);
}
/**
* Returns names for custom LDAP user attributes.
*
* @return
* LDAP user attributes as defined in the guacamole.properties file
* as ldap-user-attributes: ''
*
* @throws GuacamoleException
* If guacamole.properties cannot be parsed.
*/
public List<String> getAttributes() throws GuacamoleException {
return environment.getProperty(
LDAPGuacamoleProperties.LDAP_USER_ATTRIBUTES
);
}
}

View File

@@ -205,4 +205,14 @@ public class LDAPGuacamoleProperties {
};
/**
* Custom attribute or attributes in Guacamole user's record in the
* LDAP directory.
*/
public static final StringListProperty LDAP_USER_ATTRIBUTES = new StringListProperty() {
@Override
public String getName() { return "ldap-user-attributes"; }
};
}