get_totp_users
Report the number of users with TOTP configured across the realm. Optionally list those users and limit the scan to a maximum number of users.
Instructions
Report how many users have TOTP (OTP) configured across the realm.
Enumerates users and inspects each one's credentials for an otp entry.
KeyCloak has no bulk credential endpoint, so this makes one credential
request per user (N+1) — expect it to be slow on large realms; bound it with
max_users (which also short-circuits the user enumeration). Users whose
credential lookup fails are counted separately and skipped, so a single
transient error does not abort the whole scan.
Args:
enabled_only: Only scan enabled users (default True).
list_users: Include the list of usernames with TOTP (default True).
max_users: Cap the number of users scanned. 0 (default) falls back to
KEYCLOAK_MAX_USERS (default 5000) rather than the whole realm.
The N+1 credential loop is also bounded by KEYCLOAK_DEADLINE, so
a large realm returns a disclosed sample. When capped, the
percentage covers only the sample, not the realm.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| max_users | No | ||
| list_users | No | ||
| enabled_only | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |