krn.CheckUserAccount
This job checks whether the specified user can log into the system. The given password is checked — an incorrect password can lead to account lockout (same criteria as in the enaio® enterprise-manager).
The job returns with an error if the user cannot log into the system.
The job runs on the existing session and does not open a session for the checked user — it returns no SessionGUID, only the verdict.
1. Input Parameters
| Name | Type | Required | Description |
|---|---|---|---|
|
INT |
Yes |
Must be |
|
STRING |
Yes |
Login name of the user. Matched case-insensitively. |
|
STRING |
Yes |
Encrypted password — same format as krn.SessionLogin/ |
Password is a mandatory parameter. A call without it — for instance as a name-only existence check — is rejected with -1043332470 ("A required parameter was not specified: Password.").
|
2. Output Parameters
| Name | Type | Dependency | Description |
|---|---|---|---|
|
INT |
— |
Result of login check: |
|
INT |
only when |
Password validity: |
|
STRING |
only when |
Internal user name in the spelling the server resolved it to, e.g. |
|
STRING |
only when |
Authentication method, e.g. |
3. Return Value
(INT): 0 = job successful, otherwise error code.
In practice only Action = 0 occurs: the failure cases 2, 3, 4 and 5 documented in the table come back as an error code instead — consistent with the job returning an error if the user cannot log in.
| Code | Server message | Documented Action equivalent |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
— (caller not authorised) |
-1042218019 is returned both for a manually locked account and for one locked by failed logins, and also with a correct password. The two cases are not distinguishable from this job’s response; the user attribute locked (see Lockout Behaviour) and a context switch to the user (see Cause Codes in the Error Stack) do distinguish them.
|
Treat only |
4. Required System Role
|
The calling user needs system role
The role is necessary and sufficient and independent of every other role: a user holding only this role succeeds; a user holding the other 71 roles fails with The system roles assigned to the calling user can be determined with mng.GetUserRoles; an overview of all roles is available under System Roles. |
5. Lockout Behaviour
The server counts failed attempts per account in the attribute logincount; other accounts are unaffected. What a failed attempt does is governed by the security level Login\SecurityLevel (default 0 = no restriction; the other levels close the application or lock the account after three failed attempts). The setting does not apply to users with two-factor authentication.
Sequence on a server that locks after three failed attempts:
| Call | logincount |
locked |
Return value |
|---|---|---|---|
1st wrong password |
|
|
|
2nd wrong password |
|
|
|
3rd wrong password |
|
|
|
every further call, including one with the correct password |
|
|
|
-
The third failed attempt locks the account but still answers
-1042218021. A caller watching for-1042218019to detect the moment the lock closed will miss it. -
A successful call resets
logincountto0as long as the lock has not closed yet — alternating correct and wrong checks therefore never trip it. Once the account is locked, the correct password is refused as well and the counter stays at its maximum; only an administrative reset helps then (see below). -
The threshold itself is not readable through the API — entries such as
Security\PwdLockCount,MaxLoginAttemptsorLoginRetriesdo not exist (krn.REGetRegValue returns-1042218742). WithName=Login\SecurityLevela caller can only read whether failed attempts lock accounts, not after how many. Callers must throttle their own attempts.
5.1. Detecting and Releasing a Lock
The user attribute locked distinguishes the two kinds of lock: 1 = locked manually by an administrator, 2 = locked by failed logins. Both values are reported by mng.GetUserAttributes and mng.GetUserList.
|
The marker |
What enforces the lock is logincount, not locked — writing locked = 0 alone does not release it. The account is released by calling mng.SetUserAttributes with a complete UserInfo for the account and logincount="0"; immediately afterwards this job reports Action = 0 again.
6. Related Settings
| enaio® enterprise-manager | Registry entry | Default | Effect on this job |
|---|---|---|---|
Gültigkeitszeitraum für Passwörter |
|
|
|
Hinweis auf den Ablauf des Gültigkeitszeitraums |
|
|
drives enaio®'s own warning, not |
Einmal-Passwort |
|
|
new accounts report |
Sicherheitsstufe |
|
|
whether failed attempts lock the account; the only entry listed here that is readable via krn.REGetRegValue |
7. See Also
-
krn.SessionLogin — actual login of a session
-
krn.VerifyPassword — checks a password against the password syntax rule (not a credential check)
-
mng.GetUserAttributes — user attributes including
lockedandchangepwd -
mng.SetUserAttributes — resetting
logincountto release a lock