Support Specifying Domain Name for Kerberos Authentication. #659
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
By default the ldap3 library attempts to bind against the service principal for the domain you attempted to connect to. If your target LDAP service uses a round-robin DNS, it’s likely that the hostname you connect to won’t match. This cause it to throw the following error:
LDAP connection failure: SSPI: InitializeSecurityContext: The specified target is unknown or unreachable
In this case, you can either specify Domain Controller hostname or force the library to do a reverse DNS lookup.
This PR includes the fix to do a reverse DNS lookup automatically when using Kerberos Authentication Method by simply pass True as the first element in sasl_credentials to do a reverse DNS lookup.
There is no additional configuration end-user have to do. This solution supported Domain Controller FQDN and Domain Name
Testing Steps
Fixes #654