From 725e7d553cf4b41d317536675d23e1b8b8d64c3b Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Fri, 23 Oct 2015 15:38:44 -0700 Subject: [PATCH] GUAC-1115: Add ConfigurationService functions for retrieving search DN and password. --- .../auth/ldap/ConfigurationService.java | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/extensions/guacamole-auth-ldap/src/main/java/org/glyptodon/guacamole/auth/ldap/ConfigurationService.java b/extensions/guacamole-auth-ldap/src/main/java/org/glyptodon/guacamole/auth/ldap/ConfigurationService.java index 7d3f77b29..3550d8a4f 100644 --- a/extensions/guacamole-auth-ldap/src/main/java/org/glyptodon/guacamole/auth/ldap/ConfigurationService.java +++ b/extensions/guacamole-auth-ldap/src/main/java/org/glyptodon/guacamole/auth/ldap/ConfigurationService.java @@ -133,4 +133,42 @@ public class ConfigurationService { ); } + /** + * Returns the DN that should be used when searching for the DNs of users + * attempting to authenticate. If no such search should be performed, null + * is returned. + * + * @return + * The DN that should be used when searching for the DNs of users + * attempting to authenticate, or null if no such search should be + * performed. + * + * @throws GuacamoleException + * If guacamole.properties cannot be parsed. + */ + public String getSearchBindDN() throws GuacamoleException { + return environment.getProperty( + LDAPGuacamoleProperties.LDAP_SEARCH_BIND_DN + ); + } + + /** + * Returns the password that should be used when binding to the LDAP server + * using the DN returned by getSearchBindDN(). If no password should be + * used, null is returned. + * + * @return + * The password that should be used when binding to the LDAP server + * using the DN returned by getSearchBindDN(), or null if no password + * should be used. + * + * @throws GuacamoleException + * If guacamole.properties cannot be parsed. + */ + public String getSearchBindPassword() throws GuacamoleException { + return environment.getProperty( + LDAPGuacamoleProperties.LDAP_SEARCH_BIND_PASSWORD + ); + } + }