mirror of
https://github.com/lldap/lldap.git
synced 2026-04-25 08:15:52 +03:00
[GH-ISSUE #120] nginx-auth-ldap client #51
Labels
No labels
backend
blocked
bug
cleanup
dependencies
docker
documentation
duplicate
enhancement
enhancement
frontend
github_actions
good first issue
help wanted
help wanted
integration
invalid
ldap
pull-request
question
rust
rust
tests
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/lldap-lldap#51
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Cyrix126 on GitHub (Feb 20, 2022).
Original GitHub issue: https://github.com/lldap/lldap/issues/120
Trying to get https://github.com/kvspb/nginx-auth-ldap to work.
Here's my block in nginx.conf, I think I'm getting close.
domain name replaced. I should add that the domain name has a dash like this: nom-domaine
error in log/nginx/error.log
log in lldap (for some reason the date time is -1h, not getting the local timezone ?)
@nitnelave commented on GitHub (Feb 20, 2022):
Hmm, that's weird. It seems that LLDAP is replying as expected, but nginx (or the plugin) doesn't get or cannot read the response? I'd capture the traffic to/from nginx on that port with tcpdump and talk to the plugin owner. You can link to this issue for conversation as well, or if there's actually something wrong with the LLDAP answer.
@Cyrix126 commented on GitHub (Feb 26, 2022):
Actually the connection is fine, I just had to restart nginx to get those error log disappear, reload wasn't sufficient.
Now with debug in nginx log I understand that the line posing issue is the filter.
The filter
(&(uid=${admin})&(objectClass=people))generate those lines in nginx log:If I use
?uid?sub?(objectClass=posixAccount)and post a request with user test, lldap respond:I'm not sure how to solve this issue, what's wrong with my filter ?
@nitnelave commented on GitHub (Feb 26, 2022):
I think you might have an extra "&" in your filter. The syntax for a and b
and c is: (&(a)(b)(c)).
If that doesn't work, post the LLDAP logs with verbose enabled.
On Sat, 26 Feb 2022, 09:59 Cyrix126, @.***> wrote:
@nitnelave commented on GitHub (Feb 26, 2022):
Also, for the second query, it seems that you're somehow querying the "1.1"
attribute for users, do you know why?
On Sat, 26 Feb 2022, 10:59 Valentin Tolmer, @.***> wrote:
@Cyrix126 commented on GitHub (Feb 26, 2022):
Tried with (&(uid=${admin})(objectClass=people)) but same error from ldap (-7, Bad search filter).
the log:
https://share.libre-depanne.fr/selif/nginxlogdebugldap.txt
I have no clue. The only suspect would be the "HTTP/1.1 401 Unauthorized" with 1.1 ?
@nitnelave commented on GitHub (Feb 26, 2022):
That's the nginx logs, can I get the LLDAP ones?
As for the 1.1, it's a special LDAP attribute meaning "don't return
attributes". It's not supported yet, but it's easy to do.
On Sat, 26 Feb 2022, 14:33 Cyrix126, @.***> wrote:
@Cyrix126 commented on GitHub (Feb 26, 2022):
https://share.libre-depanne.fr/selif/lldaplogdebug.txt
For the first query with "-7, Bad search filter" as error, there is no activity from nginx to lldap when trying to log.
Le 26/02/2022 à 20:16, nitnelave a écrit :
@nitnelave commented on GitHub (Apr 17, 2022):
Sorry for the delay, I didn't do much on LLDAP the past month. With #138 it should work for the 1.1 attribute.
From the nginx logs, I see that your search query is
(&(objectClass=*)((&(uid=${admin})(objectClass=people))=test)).I think you want something simpler, like:
(&(objectClass=*)(uid=${admin})(objectClass=person))(I'm not sure what the=testis).Can you paste your nginx config (the relevant parts) so I can help you configure it?
@nitnelave commented on GitHub (Apr 29, 2022):
Hey @Cyrix126 did you manage to make nginx work? Can you share your config?
@Cyrix126 commented on GitHub (Apr 29, 2022):
I tried with recent changes. I've got passed the 1.1 error but now I'm getting:
With filter: (example from https://github.com/kvspb/nginx-auth-ldap)
url ldap://localhost:389/dc=domain,dc=com?sAMAccountName?sub?(objectClass=person);DEBUG lldap::infra::ldap_server: Replying with LDAP op: SearchResultDone(LdapResult { code: UnwillingToPerform, matcheddn: "", message: "Unsupported group filter: Unknown field: objectClass", referral: [] })And with the filter:
url ldap://localhost:389/dc=domain,dc=com?(&(objectClass=*)(uid=${admin})(objectClass=person))I do not get any interaction with lldap when trying to log in.
The nginx block for ldap:
and for the website
@nitnelave commented on GitHub (Apr 29, 2022):
Hmm, can you try with
ou=people,dc=domain,dc=commaybe?EDIT: the first error is definitely my fault, I'll have a look.
@nitnelave commented on GitHub (Apr 29, 2022):
Are you sure you tried with the latest changes? The image in question is
latestand it should be less than 10 days old (the most recent one is from 6h ago).@Cyrix126 commented on GitHub (Apr 29, 2022):
I was on commit
2197fe77a5I'll recompile with latest and see if any change.
@nitnelave commented on GitHub (Apr 29, 2022):
One commit too old :)
@Cyrix126 commented on GitHub (Apr 29, 2022):
The error "Unknown field: sAMAccountName" seems to persist after compiling to commit
4f89b73fe5@nitnelave commented on GitHub (Apr 29, 2022):
Ah yeah, but that you can just remove from the config. I'm not sure what the syntax of that URL is, but you want to request the uid of the user.
@nitnelave commented on GitHub (Apr 29, 2022):
Aha, according to https://docs.oracle.com/cd/E19396-01/817-7616/ldurl.html:
So you want:
url ldap://localhost:389/dc=domain,dc=com?uid?sub?(objectClass=person);or
url ldap://localhost:389/ou=people,dc=domain,dc=com?uid?sub?(objectClass=person);@Cyrix126 commented on GitHub (Apr 29, 2022):
That's the one.
It works now, I will prepare the example config soon enough.