Skip to content

fix: handle session login for users without a local password - #1421

Open
maniaba wants to merge 3 commits into
codeigniter4:developfrom
maniaba:fix/session-login-without-local-password
Open

maniaba wants to merge 3 commits into
codeigniter4:developfrom
maniaba:fix/session-login-without-local-password

Conversation

@maniaba

@maniaba maniaba commented Nov 29, 2026 •

Copy link
Copy Markdown

Description

Applications such as Shield LDAP can provision users without a local password. When one of those users attempts to sign in by username, Session::check() passes a null hash to Passwords::verify(), which requires a string.

Extend the existing dummy hash check to accounts without a local password hash and return Auth.badAttempt even if dummy verification succeeds. The default User entity can continue to return a nullable hash through User::getPasswordHash(): ?string.

A regression test covers username login for an existing account with no hash. A compatibility check also confirmed that the standard session authenticator rejects a directory-only account and an incorrect local password, and accepts a correct local password.

The User Guide now documents the failed result and the use of the dummy password hash for accounts without a local password. mkdocs build --strict passed.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@maniaba maniaba changed the title Fix session login for users without a local password fix: handle session login for users without a local password Nov 29, 2026
@datamweb datamweb added the bug Something isn't working label Nov 30, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants