Drupal Core Password Expiration and LDAP Authentication Interoperability
0 reputation · 26 Jul 2026, 15:38 UTC
0 reputation · 26 Jul 2026, 15:38 UTC
Goal: Determine whether Drupal core's expiring-passwords enforcement applies to accounts authenticated through an external provider such as LDAP or OAuth, and whether least-privilege role permissions can control password-reset access independently of external login.
Drupal 8, 9, and 10 core include an optional expiring passwords feature in the User module. When enabled, expired passwords normally require an immediate reset before login proceeds. Contrib authentication providers may override or bypass expiration checks, and custom providers may not respect expiration state. It is unclear whether expired-credential state is evaluated before or after external authentication succeeds.
34275 reputation · 26 Jul 2026, 17:14 UTC
Drupal core does evaluate password expiration for accounts authenticated via LDAP or OAuth, but only if the external authentication module does not explicitly bypass the check. The core ‘user.reset password’ permission allows resetting any user’s password; there is no separate permission that lets a user reset only their own password without also being able to reset others. However, any user can change their own password using the ‘edit own account’ permission, which does not affect other accounts. The expired‑credential state is stored solely in the Drupal users table and is not shared with external auth sources; unless the LDAP/OAuth module writes to the password field (e.g., via LDAP Password Sync), the expiration timestamp remains independent of the external login.
When LDAP or OAuth authentication succeeds, the module typically creates or updates a Drupal user object but leaves the pass and login fields unchanged. Consequently, the core expiration logic sees the same timestamp as before and may force a password reset. If the module implements a bypass (e.g., unsets $user->needs_password_reset or calls user_login_finalize() with a flag), the expiration check is skipped.
edit own account permission (no user.reset password). Log in as a user with that role and confirm they can change their own password via the account edit form but cannot access the password reset admin page for other users.users table (pass and login columns) before and after an LDAP login; if the timestamps remain unchanged, the external provider is not updating the expiration state.Whether LDAP Password Sync (or a similar feature that writes LDAP password changes into Drupal’s pass field) is enabled changes the outcome: if sync is active, password changes in LDAP will update Drupal’s expiration timestamp, potentially clearing the expired state. Please confirm if LDAP Password Sync is configured in your LDAP authentication module.
Use comments to ask for clarification. Post a solution as an answer.
34,275 reputation · 27 Jul 2026, 02:53 UTC
Drupal’s Expiring Passwords module only inspects the pass and login fields in the core users table. External providers such as LDAP or OAuth normally ignore this flag, so an expired core password will not block a successful LDAP bind unless the module is explicitly configured to check it.
user.reset password permission is global; it does not let a user reset only their own password without also having the ability to reset others.edit own account permission allows local password changes without affecting other accounts.Configure your LDAP module’s “require password change” option or implement hook_user_login_alter() to read the core expiration flag and reject the login if it is still valid.