Open McMlok opened 1 year ago
Tagging subscribers to this area: @dotnet/area-system-directoryservices, @jay98014 See info in area-owners.md if you want to be subscribed.
Author: | McMlok |
---|---|
Assignees: | - |
Labels: | `area-System.DirectoryServices`, `untriaged` |
Milestone: | - |
Or here is my small repo where I test it.
That link is broken.
This issue has been marked needs-author-action
and may be missing some important information.
Sorry, I did not mark repo as public. Now it is working, I hope.
Hi @McMlok,
I'm facing a similar issue. Have you resolved the issue?
BR,
Hello @corsiva,
unfortunately, not. But I was able to implement my own libraries to get data from LDAP with Novell.Directory.Ldap.NETStandard Nuget package.
How can we work on this issue? The issue still occurs. I did test and found out that the issue is not happening when I start the application from command line like dotnet application.dll . I need a help to fix this issue but I don't know how developers of Microsoft pick issues for resolving them.
BR,
Hi @buyaa-n , Have you recently worked on this issue?
BR,
@buyaa-n @steveharter Hello, I have the same issue, can you help?
Since it still happens: a workaround (!!) is to send a dummy Request of over the ldap connection, e.g. every 10 minutes.
Tcp KeepAlive doen't help. The LDAP Server closes the connection of inactivity. Proper solution would be auto rebind.
Hi All!
I have the same issue. Has someone get this error solved? I have seen in the Github forum many issues pointing to the same problem, but neither of them has really solved it.
I liked the workaround suggested by @chrbauer, but I don't intend to implement it. For sure, there is a solution to this issue besides the implementation of a sidecar code to keep the ldap connection up.
Has someone has any clue to solve the problem?
Description
I'm using Negotiate authentication in ASP.NET Core app. The application runs in docker container in on-prem K8s. I also setup loading roles to ClaimPrincipal with EnableLdap settings method. Auth works fine and loading roles but after 15minutes of inactivity in the app I got exception from LdapConnection with "The LDAP server is unavailable.". After some debugging, I end with a small console app where I open a connection perform a search then wait 15 minutes and perform the search again. When I run this app on windows everything is OK but on WSL (Ubuntu 18.04 with libldap 2.4) first iteration is OK second fails.
I tried to setup AutoReconnect = true in LdapConnection settings but with this connection is not able to Bind with error "The LDAP server is unavailable".
Is it possible to have singleton instance of LdapConnection? Or is there a way how to setup auto reconect when app runs in Linux machine?
Thank you
Reproduction Steps
Or here is my small repo where I test it.
Expected behavior
LdapConnection can perform search after 15 minutes of inactivity
Actual behavior
I could not perform search after connection is inactive more than 15minutes.
Regression?
No response
Known Workarounds
No response
Configuration
Local dev setup
WSL setup
K8s 1.24 setup
Other information
Originally, I hit this issue in Microsoft.AspNetCore.Authentication.Negotiate when I run my app on Linux box. But as I understand their code there is also only one LdapConnection instance for app and is reused for all search.