Skip to content

User Model

FieldTypeDescription
idUUID stringUnique user identifier — used as the sub claim in tokens
usernamestringLogin name; must be unique; length controlled by validation settings
passwordstringbcrypt hash of the password; never stored in plaintext
emailstringOptional email address; required if validation_email_required is true
rolestringuser or admin
created_attimestampWhen the account was created
failed_login_attemptsintegerNumber of consecutive failed login attempts; resets on success
locked_untiltimestamp (nullable)If set, the account is locked until this time
totp_secretstringTOTP shared secret (base32); empty until enrolled
totp_verifiedbooleanWhether the user has completed TOTP enrollment
is_email_verifiedbooleanWhether the email address has been verified
deactivated_attimestamp (nullable)If set, the account is deactivated and cannot log in

The admin API returns users in a safe representation that excludes the password hash and TOTP secret:

{
"id": "a3f4e5b6-1234-5678-abcd-ef1234567890",
"username": "alice",
"email": "alice@example.com",
"role": "user",
"created_at": "2024-01-15T10:30:00Z",
"failed_login_attempts": 0,
"locked_until": null,
"totp_verified": true,
"is_email_verified": true
}

The user id is the sub claim in access tokens and ID tokens. The username maps to name, and email maps to email (when the email scope is requested).