Edit Authentik users: name, email and groups

Each person in Apps → Authentik → Users gets an Edit form. The user name is
shown but not changeable. Authentik is sent only what differs, and groups as
what goes in and what comes out on top of the user's current groups, so a
membership added meanwhile is kept; a user whose groups Authentik doesn't
report can't have them changed. The server refuses service accounts, the
token's own account, and an edit that would leave no active administrator.
Audited by field name, never by value.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5.5 committed 2026-11-01 00:39:51 +01:00
1 parent 0cd11268ee
commit 3618cb3ae8
9 files changed
+370 -30

No files matched your search

+3 -3
View File
@@ -526,10 +526,10 @@ osTicket's API cannot close a ticket, so this is the one place in the app that *
The link is in the answer to that one request and nowhere else (not stored, not in the audit log); the audit log has *who made which user* and *who made a link for whom*, never the link or a token. If the user is made and the link is not (Authentik needs a **recovery flow** on the brand — System → Brands),
the page says so and the link is made in Authentik (the user → *Create recovery link*). Authentik builds the link from the address it was called at, so the integration's address should be the one people use. The token for making users is only used for this; reading Authentik never uses it,
and *Stop allowing this* on the page removes it again (the reading token stays).
**Users** on the same page lists the people (service accounts — what an outpost or an integration signs in with — are left out), searchable, with whether each is on, whether they are an administrator and when they last signed in, and lets an administrator **switch a user off** (a `PATCH` of `is_active` and nothing else;
**Users** on the same page lists the people (service accounts — what an outpost or an integration signs in with — are left out), searchable, with whether each is on, whether they are an administrator and when they last signed in, and lets an administrator **edit a user's name, email and groups** (the user name is shown but not changeable: it is how a person is known elsewhere, and renaming could make them a new person here; Authentik is sent only what differs, as a `PATCH`, and groups as what goes in and what comes out on top of the groups the user has *now*, so a membership somebody gave them meanwhile is kept; a user whose groups Authentik does not say can be renamed but not moved between groups), **switch a user off** (a `PATCH` of `is_active` and nothing else;
they can no longer sign in, nothing of theirs is lost, *Switch on* brings it back) or **delete** one (a `DELETE`, for good: the user name has to be typed, and is checked again by the server against the user as Authentik has them now). **Refused, by the server, with the reason:** a service account, the account the token
itself belongs to, and the last active administrator (so nobody can be locked out, or the sign-in in front of everything else cut off); do those in Authentik. Each is in the audit log (*who switched off / on / deleted which user*). Switching off or deleting someone in Authentik does not end a session they
already have in this app: end it under Users → *Signed in now*. Lists are read 200 at a time. Without it nothing about the page changes for anyone but an administrator, who sees where to add one. The calls (`GET /core/groups/`, `POST /core/users/`, `POST /core/users/{id}/recovery/`, `GET /core/users/`, `GET /core/users/{id}/`, `GET /core/users/me/`, `PATCH` and `DELETE /core/users/{id}/`; asking for a link that lasts a day, which a version of
itself belongs to, and the last active administrator (so nobody can be locked out, or the sign-in in front of everything else cut off — for an edit, only when it would take them out of every group that makes them one); do those in Authentik. Each is in the audit log (*who edited — which fields, never their new values — switched off / on / deleted which user*). Switching off or deleting someone in Authentik does not end a session they
already have in this app: end it under Users → *Signed in now*. Lists are read 200 at a time. Without it nothing about the page changes for anyone but an administrator, who sees where to add one. The calls (`GET /core/groups/`, `POST /core/users/`, `POST /core/users/{id}/recovery/`, `GET /core/users/`, `GET /core/users/{id}/`, `GET /core/users/me/`, `PATCH` (`is_active`, or `name`, `email` and `groups`) and `DELETE /core/users/{id}/`; asking for a link that lasts a day, which a version of
Authentik that does not take that sets for itself) are **not verified against a live Authentik**; the tests use a pretend one.
- **What it does:** every **five minutes** Authentik is read and stored — its version (and whether a newer one is out), whether a **worker** is connected, each **outpost** (the proxy outpost that guards your apps, an LDAP one) with how many instances reported in during the last five minutes and whether they run the right version, the
**certificates** (those Authentik does not renew by itself) with their expiry, the **API tokens and app passwords** that expire, and how many **sign-ins failed** and **configuration errors** happened in the last day. **Apps → Authentik** shows it, with what runs out soonest first.