Skip to content

ldap: Add GSSAPI/Kerberos authentication via native ldapsearch#764

Open
gliatti wants to merge 1 commit intodalibo:masterfrom
gliatti:feature/gssapi-native-ldapsearch
Open

ldap: Add GSSAPI/Kerberos authentication via native ldapsearch#764
gliatti wants to merge 1 commit intodalibo:masterfrom
gliatti:feature/gssapi-native-ldapsearch

Conversation

@gliatti
Copy link
Contributor

@gliatti gliatti commented Feb 24, 2026

Hello everyone,

Here is an implementation of using GSSAPI with ldap2pg as a workaround since the pure Go GSSAPI implementation (jcmturner/gokrb5) has checksum mismatch issues with MIT Kerberos KDCs, making it unusable in practice. To work around this, LDAP searches are delegated to the system ldapsearch command which uses native GSSAPI libraries, and the LDIF output is parsed back into go-ldap SearchResult objects.

Here are the limitations I noticed:

  • Requires ldapsearch installed on the system
  • Slight overhead from fork/exec per search (~25-35ms vs ~5ms compared tonative lib)

Robin,

@gliatti gliatti force-pushed the feature/gssapi-native-ldapsearch branch from 3c3f393 to 827b425 Compare February 24, 2026 13:17
The pure Go GSSAPI implementation (jcmturner/gokrb5) has checksum
mismatch issues with MIT Kerberos KDCs. This adds a native ldapsearch
wrapper as fallback when SASL_MECH=GSSAPI is configured.

When GSSAPI is detected, ldap2pg delegates LDAP searches to the system
ldapsearch command which uses battle-tested native GSSAPI libraries,
and parses the LDIF output back into go-ldap SearchResult objects.

Requires ldap-utils and libsasl2-modules-gssapi-mit on the system.
@gliatti gliatti force-pushed the feature/gssapi-native-ldapsearch branch from 827b425 to df1e155 Compare February 24, 2026 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant