diff --git a/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/ConfigurationService.java b/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/ConfigurationService.java index 2ab7aadf6..4b82e3da2 100644 --- a/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/ConfigurationService.java +++ b/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/ConfigurationService.java @@ -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 getAttributes() throws GuacamoleException { + return environment.getProperty( + LDAPGuacamoleProperties.LDAP_USER_ATTRIBUTES + ); + } + } diff --git a/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/LDAPGuacamoleProperties.java b/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/LDAPGuacamoleProperties.java index 0d3823fed..55ed37b41 100644 --- a/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/LDAPGuacamoleProperties.java +++ b/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/LDAPGuacamoleProperties.java @@ -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"; } + + }; }