bsw@1071: -- binds to configured LDAP server with application's credentials bsw@1071: -- -------------------------------------------------------------------------- bsw@1071: -- bsw@1071: -- returns bsw@1071: -- ldap_conn: in case of success, an LDAP connection handle bsw@1071: -- err: in case of an error, an error code (string) bsw@1071: bsw@1071: function ldap.bind_as_app() bsw@1071: bsw@1071: local dn, password bsw@1071: bsw@1071: if config.ldap.bind_as then bsw@1071: dn = config.ldap.bind_as.dn bsw@1071: password = config.ldap.bind_as.password bsw@1071: end bsw@1071: bsw@1071: local ldap_conn, err = ldap.bind(dn, password) bsw@1071: bsw@1071: return ldap_conn, err bsw@1071: bsw@1071: end