Onboard a Brokerage Owner
This is the manual handoff that turns a freshly-created brokerages
row into a real human who can sign in. It has to happen out-of-band
because Authentik account creation is gated by an admin login that
isn’t wired into the HomeStar admin UI.
Prerequisites
Section titled “Prerequisites”- Authentik admin access at
https://auth.supported.systems - Postgres access on the prod host (
ssh deploy@homestar.ink) - The owner’s confirmed email address — must come from the brokerage domain, not a guess based on the brokerage name
-
Create the Authentik user
Log in to
https://auth.supported.systemsasakadmin.Navigate to
Directory → Users → Create.Fields:
- Username: a stable handle, e.g.
joe.kroetch(lowercase, no spaces). This is what shows in the Authentik admin and inoidc_user_idonce the user logs in. - Name: full display name, e.g.
Joe Kroetch - Email: confirmed email, e.g.
joe@kroetchpropertygroup.com - Path:
users - Type:
Internal
Click Create.
- Username: a stable handle, e.g.
-
Set or invite a password
On the new user’s page, Reset Password → either:
- Set a temporary password and share it through a secure channel (1Password, password-protected email, in person), OR
- Click Set password → Send password reset email to let the owner pick their own password.
The “send reset email” path is preferred — Authentik handles the token expiry and the user never sees an admin-set string.
-
Add to the brokerage-owner group
On the user’s page, Groups tab → Add to group → pick the group whose name contains
brokerage_ownerorowner. The HomeStar OIDC fuzzy matcher (inidx-api/src/idx_api/auth.py) resolves any group name containing one of those substrings torole=brokerage_owner.If no such group exists, create one in
Directory → Groupsnamedhomestar-brokerage_ownerwith no parent. Future owners share this group. -
Create the user row in the HomeStar database
The Authentik account proves who logs in. The
usersrow in our DB scopes them to a specific brokerage and role. Both are needed.Terminal window ssh deploy@homestar.inkcd /home/deploy/homestardocker compose exec -T postgres psql -U mlsgrid -d mlsgrid <<SQLINSERT INTO users (email, role, agent_id, brokerage_id, created_at, updated_at)VALUES ('joe@kroetchpropertygroup.com','brokerage_owner',1, -- their agent_id, if they have an agents row; else NULL2, -- their brokerage_idNOW(), NOW())RETURNING id, email, role, agent_id, brokerage_id;SQLReplace the email, agent_id, and brokerage_id with real values. The query is idempotent on email (UNIQUE index) — re-running will fail with a constraint violation rather than create a duplicate, which is what we want.
-
Verify the login flow
Have the owner navigate to
https://app.homestar.ink/adminand click “Sign In to Dashboard.” They’ll be redirected to Authentik, complete password setup if invited, then bounce back to/adminauthenticated asbrokerage_owner.On the first successful login, our auth handler patches their
users.oidc_user_idto match the Authentik subject claim. Subsequent logins resolve via that ID instead of the email match — slightly faster and survives email changes.
Common failure modes
Section titled “Common failure modes”- “Site configuration not available” after login: the
users.brokerage_iddoesn’t match an existingbrokeragesrow or the brokerage’sslugisn’t routable to a hostname yet. Checkbrokerage_domainsand the caddy-docker-proxy advertiser logs. - 403 on owner-only endpoints: the Authentik group name doesn’t
include
brokerage_ownerorowner. The fuzzy matcher classified them as a lower role (probablyagent). Add the group or rename it. - Login succeeds but
users.rolereadsagent: the OIDC token’sgroupsclaim is empty. In Authentik, edit thehomestar-inkprovider → Scopes → ensure thegroupsscope is mapped onto the access token.
See Also
Section titled “See Also”- Roles and Permissions — what
brokerage_ownercan do thatbrokercannot. - Deployment Isolation — how the OIDC config differs between prod and demo.