private LDAPConnection bindAs(Credentials credentials) throws GuacamoleException {
  String username=credentials.getUsername();
  String password=credentials.getPassword();
  if (username == null || username.isEmpty()) {
    logger.debug("Anonymous bind is not currently allowed by the LDAP authentication provider.");
    return null;
  }
  if (password == null || password.isEmpty()) {
    logger.debug("Anonymous bind is not currently allowed by the LDAP authentication provider.");
    return null;
  }
  String userDN=getUserBindDN(username);
  if (userDN == null) {
    logger.debug("Unable to determine DN for user \"{}\".",username);
    return null;
  }
  return ldapService.bindAs(userDN,password);
}

private LDAPConnection bindAs ( Credentials credentials ) throws GuacamoleException { String username = credentials . getUsername ( ) ; String password = credentials . getPassword ( ) ; if ( username == null || username . isEmpty ( ) ) { logger . debug ( "Anonymous bind is not currently allowed by the LDAP authentication provider." ) ; return null ; } if ( password == null || password . isEmpty ( ) ) { logger . debug ( "Anonymous bind is not currently allowed by the LDAP authentication provider." ) ; return null ; } String userDN = getUserBindDN ( username ) ; if ( userDN == null ) { logger . debug ( "Unable to determine DN for user \"{}\"." , username ) ; return null ; } return ldapService . bindAs ( userDN , password ) ; }
binds to the ldap server using the provided guacamole credentials . the dn of the user is derived using the ldap configuration properties provided in guacamole . properties , as is the server hostname and port information .
