Status: Accepted Date: 2025-10-08 Authors: Sebastian Mendel
The LDAP self-service password changer application contains multiple password-related forms:
- Password change form (requires current password + new password)
- Password reset request form (email input)
- Password reset form (set new password via token)
Password managers (1Password, LastPass, Bitwarden, etc.) and browser autofill features rely on specific naming conventions and autocomplete attributes to correctly detect and populate form fields. Non-standard field names reduce user experience by requiring manual field selection or preventing autofill entirely.
The application used non-standard name attributes:
name="current"for current passwordname="new"for new passwordname="new2"for password confirmation
While autocomplete attributes were correctly set, the inconsistent naming conventions created maintainability issues and reduced compatibility with some password managers that rely on field names as a detection heuristic.
Adopt standardized HTML form field naming conventions that align with the HTML Living Standard autocomplete specification and password manager best practices:
| Field Type | name Attribute |
autocomplete Attribute |
|---|---|---|
| Username/Login | username, email, or login |
username or email |
| Current Password | current_password |
current-password |
| New Password | new_password |
new-password |
| Confirm Password | confirm_password |
new-password |
| Email (standalone) | email |
email |
Templates Changed:
templates/index.html: Updatedcurrent→current_password,new→new_password,new2→confirm_passwordtemplates/reset-password.html: Updatednew→new_password,new2→confirm_passwordtemplates/forgot-password.html: No changes needed (already usingemail)
JavaScript Changed:
static/js/app.ts: Updated field definition array to reference new field namesstatic/js/reset-password.ts: Updated field definition array to reference new field names
Backend Impact:
- No changes required to Go backend handlers
- Application uses JSON-RPC with positional parameters, not named form fields
- JavaScript sends data as
params: [username, oldPassword, newPassword]
-
Improved Password Manager Compatibility: Standard naming conventions ensure reliable detection across all major password managers (1Password, Bitwarin, LastPass, Dashlane, KeePass, etc.)
-
Better Browser Autofill: Modern browsers use both
autocompleteattributes AND field names for autofill detection; standardized names improve reliability -
Enhanced Accessibility: Assistive technologies benefit from consistent, predictable field naming patterns
-
Maintainability: Standard conventions make code more understandable for developers familiar with web standards
-
Future-Proofing: Alignment with HTML Living Standard ensures compatibility with future browser updates
-
No Backend Changes Required: JSON-RPC architecture with positional parameters decouples frontend field names from backend logic
-
Client-Side Only: Changes confined to templates and TypeScript validation logic
- Migration Consideration: If users have browser-saved credentials with old field names, they may need to re-save passwords (minimal impact due to autocomplete attributes already being correct)
- HTML Living Standard - Autofill
- MDN Web Docs - autocomplete attribute
- Password Manager Field Detection Heuristics
- WCAG 2.1 - Input Purposes
- Rejected: Password managers use field names as fallback detection mechanism when autocomplete attributes are ambiguous or missing in DOM manipulation scenarios
- Rejected: Cryptic naming reduces maintainability and provides zero semantic value for assistive technologies
- Rejected: Web standards provide better long-term compatibility than framework-specific patterns