Files
co-lite/openspec/changes/add-admin-temporary-password/proposal.md
T

2.6 KiB

Proposal

Why

Staff can only get a first password by email. Creating a user emails a temporary password, and so does the admin reset; an admin cannot set a password themselves. No email provider will be configured for go-live on 2027-01-15, so only the first administrator could ever sign in, and staff could not key in leads at the event.

The shared generator behind those temporary passwords also uses java.util.Random, which is predictable.

What Changes

  • Set temporary password: an admin with BO_USERS can generate a temporary password for another active user from the user's edit page.
    • The system picks the password (12 characters) and shows it to the admin once, with a copy button. The admin passes it to the staff member.
    • The user's old password stops working, and the user must choose a new password at the next sign-in, as after any reset.
    • The admin never chooses the value, so the existing rule that an admin cannot set another user's password to a value of their choice stays.
    • The same guards as the existing reset apply: no disabled users, no super admin unless the caller is one. A caller cannot use it on their own account.
    • The password is never stored, cached or logged unhashed. The response is marked no-store.
  • Secure generator: the shared temporary-password generator uses SecureRandom. This also covers the emailed reset, forgot-password and the password emailed at user creation.
  • Creating a user is unchanged: it still tries to email a temporary password. Without email, the admin opens the new user and sets a temporary password.

Not in this change: a "show instead of email" option on the create form, and configuring an email provider.

Capabilities

New Capabilities

None.

Modified Capabilities

  • admin-users: three new requirements: a temporary password shown to the admin, its refusals, and secure generation of every temporary password. The existing "Admin-triggered password reset" requirement is unchanged, including its rule against admin-chosen passwords.

Impact

  • solvway-core-libs: ValidateUtil.getRandomPasswordString uses SecureRandom.
  • solvway-services-system: a new internal endpoint sets a generated temporary password and returns it once.
  • solvway-mobile-api: POST /api/admin/users/{id}/temporary-password under BO_USERS.
  • solvway-admin-portal: a "Set temporary password" action and a show-once dialog on the user edit page, a proxy route, a service and i18n keys.
  • No database or dependency change. docs/deployment.md section 10 is updated: staff can now be onboarded without email.