public static void ConnectI(this ILdapConnection connection, string unixSocketPath = "", LdapVersion version = LdapVersion.LDAP_VERSION3) { var encoded = HttpUtility.UrlEncode(unixSocketPath, Encoding.UTF8); connection.Connect($"{LdapSchema.LDAPI.ToString()}://{encoded}/", version); }
public void Connect(string hostname, int port = (int)LdapPort.LDAP, LdapVersion version = LdapVersion.LDAP_VERSION3) { ThrowIfError( ldap_initialize(ref _ld, $"LDAP://{hostname}:{port}"), nameof(ldap_initialize) ); var ldapVersion = (int)version; ThrowIfError( ldap_set_option(_ld, (int)LdapOption.LDAP_OPT_PROTOCOL_VERSION, ref ldapVersion), nameof(ldap_set_option) ); }
public static void Connect(this ILdapConnection connection, int port = (int)LdapPort.LDAP, LdapVersion version = LdapVersion.LDAP_VERSION3) { connection.Connect(DomainUtils.GetDomainFromHostname(), port, version); }
private Native.Native.LdapVersion GetLdapVersion() { return((Native.Native.LdapVersion)Enum.Parse(typeof(Native.Native.LdapVersion), LdapVersion.ToString())); }
public static void Connect(this ILdapConnection connection, string hostname, int port, LdapSchema ldapSchema = LdapSchema.LDAP, LdapVersion version = LdapVersion.LDAP_VERSION3) { connection.Connect(new Uri($"{ldapSchema.ToString()}://{hostname}:{port}"), version); }
public static void Connect(this ILdapConnection connection, Uri uri, LdapVersion version = LdapVersion.LDAP_VERSION3) { connection.Connect(uri.ToString(), version); }