Class LdapConnectionFactory

Namespace: redb.Route.Ldap
Assembly: redb.Route.Ldap.dll

Named connection factory for LDAP. Register it in the route registry and reference it
by name from the endpoint URI (connectionFactory=my-ldap) so that service-account
credentials never have to appear in the URI itself — and therefore can never reach logs,
telemetry, or the Tsak dashboard.

Example:
context.AddToRegistry("corp-ldap", new LdapConnectionFactory
{
Server = "ldap.corp.local",
Port = 636,
Ssl = true,
BindDn = "cn=svc-reader,dc=corp,dc=local",
BindPassword = Environment.GetEnvironmentVariable("LDAP_BIND_PASSWORD")
});

// route carries no credentials at all:
r.From("ldap://SEARCH:dc=corp,dc=local?connectionFactory=corp-ldap&filter=(objectClass=user)")

public sealed class LdapConnectionFactory

Inheritance

Object→LdapConnectionFactory

Properties

BindDn

Bind DN for service account authentication.

public string? BindDn { get; set; }

BindPassword

Password for service account authentication.

public string? BindPassword { get; set; }

ClientCertPassword

Password for client certificate.

public string? ClientCertPassword { get; set; }

ClientCertPath

Path to client certificate for mutual TLS.

public string? ClientCertPath { get; set; }

ConnectTimeout

Connection timeout in milliseconds.

public int ConnectTimeout { get; set; }

FollowReferrals

Follow LDAP referrals automatically.

public bool FollowReferrals { get; set; }

MaxConnections

Maximum number of connections in the pool.

public int MaxConnections { get; set; }

OperationTimeout

Operation timeout in milliseconds.

public int OperationTimeout { get; set; }

Port

LDAP port (389 for plain, 636 for LDAPS).

public int Port { get; set; }

ProtocolVersion

LDAP protocol version (default 3).

public int ProtocolVersion { get; set; }

Server

LDAP server hostname or IP.

public string Server { get; set; }

Ssl

Use LDAPS (SSL/TLS from the start, typically port 636).

public bool Ssl { get; set; }

StartTls

Use STARTTLS upgrade on the plain port (389).

public bool StartTls { get; set; }

TrustAllCertificates

Skip server certificate validation (development only!).

public bool TrustAllCertificates { get; set; }