Enterprise login: Keycloak SMTP + self-service password reset #129
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo_admin/basketball-api#129
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type
Feature
Lineage
plan-wkq→ Phase 11 → discovered scope (parents can't login)Repo
forgejo_admin/basketball-apiUser Story
As a parent
I want to reset my own password via "Forgot Password"
So that I can log in without contacting an admin
Context
Parents report they can't log in (2026-03-21). Keycloak logs confirm
invalid_user_credentialsfor multiple users andemail_send_failed: No sender address configured in realm settings. Accounts were auto-created with generated passwords emailed in plaintext — parents who lost them are stuck. Self-service password reset requires SMTP configured in Keycloak realm.Enterprise fix: stop generating passwords entirely. Use Keycloak's execute-actions-email API to let users set their own password on first login. Keycloak SMTP uses Gmail app password for
westsidebasketball@gmail.comviasmtp.gmail.com:587.File Targets
src/basketball_api/services/keycloak.py— changecreate_keycloak_user()to not set password, addtrigger_set_password_email()using execute-actions-email APIsrc/basketball_api/services/email.py— remove plaintext password from announcement email templatessrc/basketball_api/routes/admin.py— updateadmin_send_tryout_announcementto stop generating/resetting passwordsscripts/backfill_password_reset.py— one-time script to trigger password setup for all existing parentsFiles the agent should NOT touch:
src/basketball_api/auth.py— JWT validation, unrelatedsrc/basketball_api/routes/register.py— registration flow, separate concernAcceptance Criteria
smtp.gmail.com:587)Test Expectations
create_keycloak_userno longer sets password credentialtrigger_set_password_emailcalls execute-actions-email endpointpytest tests/ -k "keycloak or announcement"Constraints
services/keycloak.pyChecklist
Related
Westside Basketball— project