mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 05:31:22 +00:00
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:
@@ -227,7 +227,7 @@ public class ConfigurationService {
|
|||||||
private int getMaxResults() throws GuacamoleException {
|
private int getMaxResults() throws GuacamoleException {
|
||||||
return environment.getProperty(
|
return environment.getProperty(
|
||||||
LDAPGuacamoleProperties.LDAP_MAX_SEARCH_RESULTS,
|
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
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -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"; }
|
||||||
|
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user