-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
LDAP BindDN Multiple Log In Options Results in 500 #9809
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Could it be that there are multiple records with same employeeNumber? |
First off, this is a great question. I would not have thought of this if you had not pointed out. However, the short answer is no. Right now, there are only two users it Gitea: an admin account (local), and my account (AD). As for the Domain itself, no. using the Powershell command And each employee at the company gets a unique employeeNumber. Once issued, it is never used again by another user. |
So looking at your stack trace here is the causative line: Line 477 in 948dec3
I suspect that user is nil at this point |
yup. It would be. Because the user is trying to login with their EID not their username - so gitea hasn't matched that username. |
Line 792 in 948dec3
And lo and behold it is nil |
@zeripath Thank you for your excellent tracking down skills and for the patch. It is greatly appreciated and you did great work! |
[x]
):The log file contains when I tried to log in with my
employeeNumber
(error), then immediately trying to log in with myemail
(works).Description
Adding multiple options for end users to log in results in a 500 error
...les/context/panic.go:35:1() [E] PANIC:: runtime error: invalid memory address or nil pointer dereference
.Using an Authentication Source of LDAP (via BindDN), with a User Filter of
(&(objectClass=Person)(|(sAMAccountName=%[1]s)(mail=%[1]s)(employeeNumber=%[1]s)))
and Username Attribute ofsAMAccountName
. Oddly enough, end users can log in usingsAMAccountName
or theiremail
and it works great. However, when they go to log in with their employeeNumber, it will result in a 500 error.If it helps, all the fields I am using in Microsoft AD are of Syntax DirectoryString.
Gogs error is here.
My Environment
git clone https://github.com/go-gitea/gitea.git&&git checkout release/v1.11&&TAGS="bindata sqlite sqlite_unlock_notify" make build
Screenshots
N/A
The text was updated successfully, but these errors were encountered: