“Account is not fully set up” does not mean the password or code is wrong. A required action is pending for the user – for example setting up OTP again after the admin deleted the old device. It can only be done in the browser.
Symptom
CID=$(kcadm get users/$OID/credentials -r lab \
| jq -r '.[] | select(.type=="otp") | .id')
kcadm delete users/$OID/credentials/$CID -r lab
kcadm update users/$OID -r lab -s 'requiredActions=["CONFIGURE_TOTP"]'
kcadm get users/$OID/credentials -r lab | jq -r '.[].type'
otto
password
password-history
{"error_description":"Account is not fully set up","ok":false}
After deleting the OTP credentials and setting CONFIGURE_TOTP, the login fails.
Diagnosis
The user's credentials show: no otp any more, only the password – the required action CONFIGURE_TOTP is waiting. The admin console lists both under Credentials and Required user actions.
kcadm get users/$OID/credentials -r lab | jq -r '.[].type' password password-history
Causes
Required actionPending task for the user
CONFIGURE_TOTP, UPDATE_PASSWORD or VERIFY_EMAIL block the login until they are done.
Password grantRequired actions only work in the browser
The password grant cannot show forms. That is why Keycloak issues no token here.
Fix
SECRET='…' # neues Secret aus dem Browser
SECRET=${SECRET// /}
sleep $((31 - $(date +%s) % 30))
otto -d totp=$(oathtool --totp -b "$SECRET")
{"error_description":null,"ok":true}
Don't: Do not simply remove the required action as admin to force the login – that defeats MFA for the account.
Keycloak hands-on, Day 10: MFA and policies – password policy, OTP, lost device and brute-force protection.
Go to day 10 →
FAQ
Does the error tell me whether the password or the code was missing?
No. For wrong credentials Keycloak only says Invalid user credentials, so attackers learn nothing.
Why is kcadm logged out after the browser work?
The kcadm session expires after 30 minutes (Session has expired); log in again.