Authn.tech
Home
  • SAML 2.0
  • OAuth 2.0
  • OIDC
  • WebAuthn / Passkey
  • MFA / TOTP
  • LDAP
  • All Tools
  • JWT Decode
  • JWT Sign
  • JWK Gen
  • JWK → PEM
  • PEM → JWK
  • PKCE Gen
  • OIDC Discovery
  • TOTP
  • WebAuthn
  • SAML Codec
  • SAML Metadata
  • SAML Response
  • X.509 Cert
  • PEM Inspect
  • Base64URL
  • LDAP Filter
  • Overview & Roles
  • OIDC Mock
  • SAML Mock
  • Mail Server
  • LDAP Directory
  • OIDC Login Demo
  • SAML Login Demo
  • 简体中文
  • English
  • Deutsch
GitHub
Home
  • SAML 2.0
  • OAuth 2.0
  • OIDC
  • WebAuthn / Passkey
  • MFA / TOTP
  • LDAP
  • All Tools
  • JWT Decode
  • JWT Sign
  • JWK Gen
  • JWK → PEM
  • PEM → JWK
  • PKCE Gen
  • OIDC Discovery
  • TOTP
  • WebAuthn
  • SAML Codec
  • SAML Metadata
  • SAML Response
  • X.509 Cert
  • PEM Inspect
  • Base64URL
  • LDAP Filter
  • Overview & Roles
  • OIDC Mock
  • SAML Mock
  • Mail Server
  • LDAP Directory
  • OIDC Login Demo
  • SAML Login Demo
  • 简体中文
  • English
  • Deutsch
GitHub
  • LDAP

    • LDAP Overview
    • Core Concepts
    • Typical Flows
    • Parameters and Syntax Reference

LDAP Parameters and Syntax Reference

Search Filters (RFC 4515)

FormMeaningExample
(attr=value)Equality(uid=alice)
(attr=*)Attribute present(mail=*)
(attr=a*b*c)Substring (wildcard *)(cn=Al*), (mail=*@example.com)
(attr>=value)Greater than or equal(uidNumber>=1000)
(attr<=value)Less than or equal(uidNumber<=2000)
(attr~=value)Approximate match(cn~=alise)
(&(f1)(f2)…)Logical AND(&(objectClass=person)(uid=alice))
(|(f1)(f2)…)Logical OR(|(uid=alice)(uid=bob))
(!(f))Logical NOT(!(objectClass=computer))
(attr:rule:=value)Extended matchAD bitwise AND: (userAccountControl:1.2.840.113556.1.4.803:=2)

Value escaping: special characters must be converted to \ + two hex digits — * → \2a, ( → \28, ) → \29, \ → \5c, NUL → \00. The Filter Builder will escape automatically.

Common Attributes

AttributeMeaning
dcdomainComponent (e.g., dc=example,dc=com)
ouorganizationalUnit (organizational unit / container)
cncommonName
sn / givenNamesurname / given name
uiduser ID
mailemail
member / memberOfgroup member DN / groups the user belongs to
objectClassentry type (multivalued)
userPasswordpassword (usually not readable)
sAMAccountName / userPrincipalNameAD login name / UPN

Common objectClasses

objectClassPurpose
topabstract base class for all entries
domain / dcObjectdomain component entry
organizationalUnitcontainer / OU
person → organizationalPerson → inetOrgPersonperson (progressively extending attributes)
groupOfNames / groupOfUniqueNamesgroup (list members in member)
posixAccount / posixGroupUnix account / group (uidNumber, etc.)

LDAP URL (RFC 4516)

ldap://host:port/base?attributes?scope?filter
ldaps://ldap.example.com/ou=people,dc=example,dc=com?cn,mail?sub?(uid=alice)

scope takes base / one / sub.

Common Result Codes

CodeNameMeaning
0successSuccess
32noSuchObjectbase DN does not exist
49invalidCredentialsbind failed (wrong DN/password)
34invalidDNSyntaxDN syntax error
50insufficientAccessRightsinsufficient permissions
4sizeLimitExceededexceeded result size limit
19constraintViolationconstraint violation (e.g., password policy)

ldapsearch Quick Reference

# Search (LDAPS + service account)
ldapsearch -H ldaps://ldap.example.com -x \
  -D "cn=reader,ou=apps,dc=example,dc=com" -w '****' \
  -b "dc=example,dc=com" -s sub "(&(objectClass=person)(departmentNumber=eng))" cn mail

# Verify a user's password (simple bind; successful connection means password is correct)
ldapwhoami -H ldaps://ldap.example.com -x \
  -D "uid=alice,ou=people,dc=example,dc=com" -w '****'

Want to try directly: Filter Builder + Mock LDAP (example directory dc=example,dc=com).

Last updated: 7/6/26, 8:43 AM
Contributors: linux, Claude Opus 4.8
Prev
Typical Flows