-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
LDAP BindDN Multiple Log In Options Results in user already exists error #9897
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
I don't understand this definitely checks if the user is in existence |
ah I do. |
Sorry I missed fixing this... I presumed that the ErrUserExist would be handled correctly. That's what I get for presuming. |
Don't fret. You did fix the initial ticket (500 error no longer happens) so it was technically correct and you did fix the problem... Now referencing the age old adage of, "Assume makes an a** out of u and me" 🤦♂ I did know that this would happen as that is the error I got in the logs with Gogs. |
So the issue is that the signature for ExternalUserLogin is wrong. It is: Line 694 in 27c6b8f
It's only ever called in two ways: Line 786 in 27c6b8f
and Line 800 in 27c6b8f
In the first case user cannot be nil so detecting whether we need to do autoRegister doesn't need to be a separate argument. The same broken signature is passed to LoginViaLDAP too. |
How do I |
Nevermind:
PS IT WORKS!!! |
[x]
):Description
When logging in with LDAP with multiple log in options that are not the typical "username" or "email" uid's, you must check if the user exists and then authenticate using what is defined in "Username Attribute".
What should occur
When logging in with a non-standard option like
employeeNumber
, it should authenticate to LDAP, if passes then check if user already exists, if not, create user, if already exists and password is good, log the user in.What is happening
When logging in with a non-standard option like
employeeNumber
, it will try to create a new user without checking to make sure that user does not already exist which results in an invalid credential on log in page.Relevant lines of code:
models/login_source.go
Lines 527 - 533.Screenshots
My environment
git clone https://github.com/go-gitea/gitea.git&&git checkout release/v1.11&&TAGS="bindata sqlite sqlite_unlock_notify" make build
Other
Semi-relevant ticket that fixed the 500 error associated with same scenario.
The text was updated successfully, but these errors were encountered: