dotnet / dotnet/aspnetcore

LDAP support in negotiate authentication fails with "connection reset by peer"

Open
#27,968 6 comments 0 reactions 0 assignees View on GitHub
affected-few area-auth blocked bug severity-major
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 6h
Merged PRs (30d)
290

Description

When using LDAP under Linux, so that one can have group membership in negotiate authentication, the connection to the LDAP server (domain controller) fails with error "connection reset by peer".

The reason is that the connection to the LDAP server is made when the server application starts up. But if the connection is idle, it is closed. Thus the error when an query is made.

Either the connection should be retried after receiving ECONNRESET error, or tcp keepalive should be enabled.

In addition, the connection is unencrypted, therefore ldap user and password are sent in cleartext. It should be possible to enable TLS in LdapSettings.

Of course, the right thing to do would be to parse the group membership data from the Kerberos ticket.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.