Skip to content

This page is for integrators and engineers who create or manage users programmatically, or who need to know exactly what the user screens in Administration do underneath. The administrator’s view of the same tasks, with the screens, is Managing users. Sign-in itself (identity server, providers, second factors) is covered for operators in Identity server & external providers.

A “user” is represented in two places that are kept in sync automatically:

PlaneServiceStorageHolds
Business recorddata-serviceThe USER data entity (data-entry documents)Profile fields (basic_info, account_information, phone_number), org-unit/group assignments, is_deactivated flag
Identity accountusers-serviceThe Mongoose user collection (UserSchema)Credentials (username, hashed password), email, MFA config, login-lockout counters, isDeactivated

You (or an integration) manage the business record, the USER data entry, through the normal data-entry create/update/archive flows. The users-service listens for the resulting domain events and provisions, updates, or removes the matching identity account. You never create the identity account directly; it is a side effect of the data-entry lifecycle.

Only entries whose user type is Normal (basic_info.user_type.id === 'NORMAL_USER') become sign-in accounts. Application users (APPLICATION_USER) get an API token instead (see Application users).

Provisioning: what happens when a USER entry is created or changed

Section titled “Provisioning: what happens when a USER entry is created or changed”

Every create, update, archive or restore event for a USER entry triggers one reconcile: the identity records are brought in line with the entry as it currently is (re-read at handling time). Because of this, the order in which the events arrive does not matter: an update that arrives before its create is no longer lost. Since 1.10

For an active Normal entry, the reconcile upserts the identity account:

  1. It looks for an existing account by the entry id, then by email (only if that account has the same id).
  2. Existing account → copies username and email (only when non-blank, so a blank value never overwrites), and always copies isExternal, externalUserId, isDeactivated, phoneNumber and phoneVerified. The password is never touched.
  3. No account, but another account already owns the email → nothing is created; the conflict is logged. This is how email de-duplication works.
  4. No account → creates one with a random UUID as the initial password. This placeholder is not a usable credential.
  5. For a newly inserted internal user (isExternal not true), it creates a reset token and, if the password-reset email template resolves, publishes the “set your password” email. The email is sent exactly once, by the call that inserted the account. External (federated or directory-imported) users get no email; they authenticate through their external provider.

An archived or missing entry removes the identity account; a draft entry is left alone.

Required identity fields. username, password and email are required on the identity account. If account_information.username or account_information.email_address is missing on the entry, validation fails and the account is not created (logged, not retried), so always populate both.

Uniqueness and case-insensitivity. Email and username lookups are case-insensitive, so Jane@x.com and jane@x.com resolve to the same account. Email uniqueness at creation is an application-level check, not a database constraint; only externalUserId has a true unique index, so two accounts cannot share the same external identity id.

Handler reliability. The provisioning handlers re-throw on failure so the event bus retries the message, with one exception: a Mongoose validateSync failure during account creation or restore is logged and the message is dropped instead of retried, so a malformed entry cannot get stuck in a poison-message retry loop.

Organization account and assignments. The assignment validator refuses an ASSIGNMENT for a user whose account_information.organization_account.id is not ORGANIZATION_ACCOUNT_TRUE (“User must be an organization account”).

Editing flows through the USER data entry and the identity account follows automatically (see step 2 above). Editing the entry does not change the password; passwords change only through the reset and change flows.

The deactivation state is mirrored on every edit: the identity account’s isDeactivated is set from the entry’s is_deactivated whenever the USER entry is updated, not only through the dedicated activate/deactivate endpoints.

Archiving the USER entry hard-deletes the matching identity account: its credentials and MFA configuration are removed.

Restoring an archived user re-provisions the identity account with a fresh random password and, for internal users, a new reset link, carrying over the deactivation state. Because a new password is assigned, a restored internal user must set a new password through the reset email before signing in. Since 1.6

An admin-initiated reset requires the SystemAdmin role and publishes a reset event; users-service then creates a reset token and emails the user. The admin never sees or sets the password.

RuleRequirement
Minimum length8 characters
Upper + lower caseat least one of each
Letters + digitsat least one of each
Special characterat least one symbol

Passwords are hashed before storage; the plaintext is never persisted.

Users manage their own passwords through pages served by the identity service:

  • Change password: requires an authenticated session. Not available to external accounts. Validates the old password, forbids reusing it, and enforces the password policy.
  • Request reset: a public form. A reset email is sent only if the account exists, is not external, and is not deactivated. Lookup is case-insensitive, and the form always shows a success message whether or not a matching account was found (no account-enumeration signal).
  • Complete reset: validates the reset token, applies the password policy, updates the password, and invalidates the token.

Reset-token lifetime and hashing are described in Identity server: password reset.

The activate/deactivate endpoints require the SystemAdmin role, with two guards:

  • You cannot deactivate or activate yourself: the request is rejected with 400 Bad Request. (The admin screens also hide the actions on your own row.)
  • Idempotency guard: deactivating an already-deactivated user, or activating an already-active one, returns 409 Conflict.

Deactivation is enforced at two layers: login is blocked (a deactivated account cannot sign in, and an existing session cannot resolve it), and active tokens are revoked, so existing sessions are cut off rather than lingering until expiry. The sign-in page shows the ACCOUNT_DEACTIVATED message (“The account is deactivated, Please contact with your system administrator”). Reactivating clears the flag; the user signs in again with their existing credentials.

Deactivation removes every session record Since 1.10

Section titled “Deactivation removes every session record Since 1.10”

The identity service keeps an index of every record that belongs to an account, and deactivation deletes exactly those: grants, sessions, access tokens and refresh tokens, so nothing lingers. Before 1.10, refresh tokens could not be found by the old scan and grant and session records were never deleted. The visible rule did not change (a deactivated account already could not sign in or refresh); the difference is that no stale record survives. Records written before the upgrade are not indexed and expire on their own lifetime.

Lockout is automatic and protects against brute-force sign-in:

  • Each failed login increments the failed-attempt counters and stamps the last-failed-attempt time.
  • When failed attempts reach 5, the account is locked. The lockout window is set to the current time plus the number of failed attempts since the last success (in minutes), so the window grows with repeated lockouts.
  • A locked account is refused login until the lockout window elapses (“Account is locked”).
  • A successful login clears all counters and the lock, and stamps the last-login time.

There is no admin “unlock” endpoint; a lockout clears when its window elapses or when the user next authenticates successfully.

Per-user MFA configuration is stored on the identity account:

  • TOTP (authenticator app) config, with the shared secret stored encrypted and a confirmation flag once the user completes enrollment.
  • A preferred method: one of totp, sms, email or passkey.

Enrollment, enforcement at login and management are user-facing sign-in flows rather than admin CRUD. From the admin side, MFA travels with the identity account: it is provisioned, deleted and restored with it. TOTP enrollment, passkeys and password step-up are refused for external accounts.

The current user’s profile is a cached read model that assembles:

  • The subject id, name and email.
  • The user’s groups, split into user groups, roles, org-unit groups and query groups (virtual groups are filtered out).
  • The user’s collections and main org unit.
  • The fully resolved permission set (or the delegate’s permissions when acting under a delegation).

Related read endpoints return the user’s non-virtual groups, their direct manager (walked from the org-unit parents), and the members of their org unit together with its parent and child org units. See Groups, org units & membership.

The SYSTEM user is a special case: it short-circuits to a synthetic profile with empty groups and permissions rather than being assembled from stored data.

Alongside the profile, the platform exposes membership checks used across authorization and workflow to answer “does this user belong to X”:

  • Static group membership: whether the user belongs to a given GROUP.
  • Dynamic query-group membership: whether the user belongs to a query group. Query-group membership is materialized into USER_QUERY_GROUP_ASSIGNMENT lookup entries by background handlers, so the check is a fast existence test against active assignments rather than a live re-evaluation of the query. Since 1.8
  • Collection membership: whether the user belongs to a given collection.

Per-user UI preferences are stored in the USER_STATE data entity. They are per-user, not admin-managed. A default state is created on first access, can be updated, and can be reset back to defaults.

FieldMeaning
firstLogintrue for a freshly created state; drives first-login UX
languagePreferred language
themePreferred theme
fontSizeUI font size
menuMode / layoutModeMenu display and layout modes
timeZonePreferred time zone
dateFormat / timeFormat / dateTimeFormatPreferred date/time formatting

The default state sets firstLogin: true and leaves every preference empty; the client falls back to organization or system defaults until the user chooses.

Application users represent external systems. They are USER entries with basic_info.user_type.id === 'APPLICATION_USER' and an application_information block; they authenticate with an API token sent in the request header, and the platform treats each request as coming from the application user. Token mechanics, headers and revocation are in API tokens.

For an active application entry, the reconcile upserts the API token from application_information (name, expiry_date, unlimited_expiry); the token’s active flag follows is_deactivated. A new application user’s token is minted and announced only once, and only to the person who created the entry; if that person’s identity record cannot be found, no token is created.

Before 1.8, an application’s token was minted exactly once, when its entry was created; rotating it meant deleting and recreating the application and losing its identity, access rights and audit trail. A SystemAdmin can rotate it in place:

  • The new token is emailed to the administrator who requested it. It is never shown on screen or returned by the API.
  • The replaced token keeps authenticating for a configurable grace window, so an in-flight integration is not broken the instant the button is clicked.
  • Archived applications cannot be regenerated (regeneration can create a token document from scratch, which would resurrect a credential for a decommissioned application); deactivated ones can.

The Regenerate Token action is offered wherever an application user’s row menu appears: the application entry’s own header action menu, the user list row menu in Entity Manage, and the user list row menu in Settings. All three share one confirmation dialog and send the same request. The full rotate-versus-self-heal mechanics and the grace-window configuration are in API tokens: regenerating a token.

  • Expiry date. The application user form’s Expiry date field (application_information.expiry_date) used to be seeded permanently hidden, so no application user could be given an expiry and every API token was created without one. Migration 1.10.0-a42 makes it a Date field that is hidden only for normal users or when unlimited expiry (unlimited_expiry) is on; a hide condition an administrator had already set is kept. It is not mandatory. A token validates only against a plain yyyy-MM-dd date: an entry whose expiry was stored earlier as a timestamp is listed by the migration (by entry id, not rewritten), and its token is treated as expired until the date is re-entered.
  • Issuer. Migration 1.10.0-a34 adds a hidden, read-only issuer field to the same block. The marketplace flow uses it to mark the application users it creates, and those users are left to the marketplace when tokens are reconciled. Administrators neither see nor set it.
  • A new tenant’s first administrator (in a multi-tenant deployment) receives an identity account and a set-password email when the tenant becomes active. See Per-tenant identity.

On data-service’s UserController (all under the Auth2 strategy):

Method & pathAuthNotes
POST /v1/users/{userId}/reset-passwordSystemAdminAdmin-triggered password reset email
POST /v1/users/{userId}/regenerate-app-tokenSystemAdminRotate an application user’s API token; rejects archived entries
POST /v1/users/{userId}/deactivateSystemAdmin400 on self; 409 if already deactivated
POST /v1/users/{userId}/activateSystemAdmin400 on self; 409 if already active
GET /v1/users/profileAuthenticatedCurrent user’s profile
GET /v1/users/{userId}/profileService-onlyAnother user’s profile (undocumented)
GET /v1/users/{userId}/delegation/{delegationId}/profileService-onlyProfile under a delegation
GET /v1/users/my-groupsAuthenticatedNon-virtual groups
GET /v1/users/direct-managerAuthenticatedDirect manager
GET /v1/users/my-orgunitAuthenticatedOrg-unit peers + parents + children
GET /v1/users/stateAuthenticatedGet/create user state
PUT /v1/users/stateAuthenticatedUpdate user state
PUT /v1/users/state/resetAuthenticatedReset user state

Creating, editing, archiving and restoring users uses the generic data-entry endpoints on the USER entity. See Writing data.

  • Restore archived user (re-provisioning the identity account): Since 1.6.
  • Multi-factor authentication (per-user MFA/TOTP config): Since 1.8.
  • Dynamic query-group membership (materialized USER_QUERY_GROUP_ASSIGNMENT lookups): Since 1.8.
  • Regenerate an application’s token: Since 1.8.
  • Application user expiry date (settable), issuer field, order-independent identity reconcile, complete removal of session records on deactivation: Since 1.10.
  • Activate/deactivate, admin-initiated password reset and user preferences (user state) predate the 1.2 milestone and are long-standing features.

Platform 1.10.0 · Backend 1.11.0-alpha.11 · Frontend 1.11.0-alpha.6 · Mobile 1.10.2 · Chart 1.11.8 · Gateway 2.6.11 · MCP 0.2.0 · Grafana DS 1.2.0Docs build 2026-11-27