Repository navigation
fix(login): drop the session when the directory fails during a login - #4032
Merged
Merged
Conversation
When the directory accepted the password and the following search failed (a result cut off by a size limit, a lost connection), the form login answered HTTP 500 and left the session bound to the user, without a LOGIN record. The form login and the SSO login now log the user out and go back to the login page with an error.
marevol
force-pushed
the
fix/login-form-directory-failure
branch
from
December 4, 2026 05:57
d031a13 to
64a363e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
With LDAP, a directory can accept the password and then fail a search made for the same login, for example when the result is cut off by a size limit (reported as a failure since #4022) or the connection is lost.
/api/v2/auth/loginhandles this: it answers 503 and drops the session. The form login (POST /login/login) did not: it answered HTTP 500, and the session stayed bound to the user. Once the directory recovered, the same cookie was authenticated although noLOGINrecord had been written to the audit log.Change
LoginAction: onLdapOperationException, log a warning, log the user out and show the login form with "Login failed." (the password was not refused, so no failure is recorded against the user).SsoAction: the same handling on the SSO login, which has the same shape.Tests
LoginActionTestandSsoActionTest; both fail without the change.