Skip to content

Keycloak required actions reference

Each built-in Keycloak required action, what the user sees and when to use it, plus the kc_action link and admin API calls that ask for one.

Runs in your browser. Nothing you paste is sent to us.

Required actions

UPDATE_PASSWORD
Update PasswordA form to choose a new password, checked against the realm’s password policy.After an admin sets a temporary password, or to force a change after a leak.
CONFIGURE_TOTP
Configure OTPA QR code to scan with an authenticator app, then a code to confirm it.To make a user set up one-time codes before their next sign-in finishes.
VERIFY_EMAIL
Verify EmailA page saying an email was sent, with a link to confirm the address.When the address must be proven. Needs the realm’s email settings.
UPDATE_PROFILE
Update ProfileA form with their profile fields (name, email and any user profile attributes).To collect missing details, for example after an import.
TERMS_AND_CONDITIONS
Terms and ConditionsThe terms text with accept and decline buttons.When users must accept terms. Off by default: enable it under Authentication, Required actions.Change the text with a theme’s messages (termsText).
VERIFY_PROFILE
Verify ProfileA form asking for profile fields that the user profile requires but the user lacks.Keycloak adds it on its own when the user profile’s required fields are missing.
webauthn-register
Webauthn RegisterA prompt to register a security key or passkey as a second factor.To set up WebAuthn as a second factor.
webauthn-register-passwordless
Webauthn Register PasswordlessA prompt to register a passkey for signing in without a password.For passwordless sign-in with a passkey.
delete_account
Delete AccountA confirmation page to delete their own account.Lets users delete their account. Off by default; the user also needs the delete-account role of the account client.
update_user_locale
Update User LocaleNothing: it saves the language picked on the sign-in page to the user.Keep it on when the realm offers several languages.
CONFIGURE_RECOVERY_AUTHN_CODES
Recovery Authentication CodesA list of one-time recovery codes to save.A backup second factor. In older versions it is behind the recovery-codes feature.
delete_credential
Delete CredentialA confirmation to remove one of their credentials, such as an OTP device.Started by an app with kc_action=delete_credential:<credential id>.
UPDATE_EMAIL
Update EmailA form to change the email address, with a verification email when that is on.Needs the update-email feature in versions where it is not on by default.

Ask for one

An app can ask for an action during sign-in by adding kc_action to the authorization request. Keycloak shows the action, then returns to the app. Not every action can be started this way.

Made-up values are filled in.

Authorization URL with kc_action
https://auth.example.com/realms/acme/protocol/openid-connect/auth?client_id=web-app&redirect_uri=https%3A%2F%2Fapp.example.com%2Fcallback&response_type=code&scope=openid&kc_action=UPDATE_PASSWORD
Set it on a user (admin API)
PUT /admin/realms/acme/users/<user-id>
{"requiredActions":["UPDATE_PASSWORD"]}
Email the user a link (admin API)
PUT /admin/realms/acme/users/<user-id>/execute-actions-email
["UPDATE_PASSWORD"]

13 built-in actions listed

How to use it

  1. Find the action by name or by what it does.
  2. Read what the user sees and when it fits.
  3. Build a link with kc_action for an app to ask for it during sign-in.
  4. Or set it on a user, or email it, with the admin API.

What to know

A required action is a step a user must finish before the sign-in completes, such as updating a password or setting up one-time codes. An admin can set one on a user, and Keycloak adds some itself.

Apps can start some actions themselves by adding kc_action to the authorization request, for example to let users change their password from the app.

Some actions, such as Terms and Conditions and Delete Account, are off by default. Turn them on under Authentication, Required actions.

What a required action is

A required action is a step a user must finish before their sign-in completes. Keycloak shows it after the user proves who they are and before it sends them back to the app. Until they finish it, they do not get tokens.

Typical examples are choosing a new password after an admin set a temporary one, verifying an email address, or setting up one-time codes. The user sees a Keycloak page for the step, and the app does not have to build any of it.

In production, required actions are how you roll out a security change to existing users without a big-bang migration. Mark the users, and each one completes the step at their next sign-in.

How Keycloak 26 handles required actions

Each required action has an alias, such as UPDATE_PASSWORD, which is the value stored on the user. The realm lists its required actions under Authentication, Required actions, where each can be enabled or disabled and some can be set as a default action for new users.

A user’s pending actions are in the requiredActions field of the user. When more than one is pending, Keycloak shows them one after another in the same sign-in.

Three ways an action gets on a user

  • An admin sets it, in the console on the user’s details or through the admin API.
  • Keycloak adds it itself, for example UPDATE_PASSWORD when an admin sets a temporary password, or VERIFY_PROFILE when the user profile requires fields the user lacks.
  • An app asks for it during sign-in with the kc_action parameter. This is an application initiated action: it applies to that sign-in only.

Asking for an action from the app

An app sends the user to the normal authorization endpoint with one extra parameter. Keycloak shows the action, then returns to the app’s redirect URI as usual.

A change-password link for the sample client web-app (wrapped for reading)
https://auth.example.com/realms/acme/protocol/openid-connect/auth
  ?client_id=web-app
  &redirect_uri=https%3A%2F%2Fapp.example.com%2Fcallback
  &response_type=code
  &scope=openid
  &kc_action=UPDATE_PASSWORD

Not every action can be started this way, and the alias must be spelled exactly. Test each kc_action link with a test user before you rely on it.

The built-in actions

AliasWhat the user sees
UPDATE_PASSWORDA form to choose a new password, checked against the password policy.
CONFIGURE_TOTPA QR code for an authenticator app and a code to confirm it.
VERIFY_EMAILA notice that a verification link was emailed.
UPDATE_PROFILEA form with their profile fields.
VERIFY_PROFILEA form for required profile fields they are missing.
TERMS_AND_CONDITIONSThe terms, with accept and decline.
webauthn-registerA prompt to register a security key or passkey as a second factor.
webauthn-register-passwordlessA prompt to register a passkey for passwordless sign-in.
CONFIGURE_RECOVERY_AUTHN_CODESA list of recovery codes to save.
delete_accountA confirmation to delete their own account.
delete_credentialA confirmation to remove one of their credentials.
update_user_localeNothing visible: it saves the language they picked.
UPDATE_EMAILA form to change their email address.

Aliases are case-sensitive and not all in capitals. delete_account and webauthn-register are written exactly as shown.

Some actions depend on features or settings. Terms and Conditions and Delete Account are off by default. Recovery codes and Update Email sit behind feature flags in versions where they are not yet on by default. Check the Required actions tab of your realm for what your version offers.

What this tool does

The reference lists the built-in actions with their aliases, what the user sees and when to use each. A filter finds one by alias or by what it does.

Next to the list, it builds three things for the action you pick: an authorization URL with kc_action for your client, the admin API call that sets the action on a user, and the call that emails the user a link to complete it.

What it does not do

It does not check whether your realm has an action enabled, or whether your version supports starting it with kc_action. It lists built-in actions only, not ones added by extensions. It runs in your browser and sends nothing.

How to use it

  1. Type a word such as password, otp or email to find the action you need.
  2. Read what the user will see and when the action fits.
  3. Enter your server, realm, client id and redirect URI.
  4. Pick the action and copy the authorization URL, or the admin API call for a user.
  5. Test the link with a test user before you put it in your app.

Where it pays off

Required actions solve a handful of everyday problems well.

Onboarding imported users

After importing users without passwords, set UPDATE_PASSWORD on each so they choose one at first sign-in. Add UPDATE_PROFILE if the import left out names or other fields.

Rolling out two-factor sign-in

Set CONFIGURE_TOTP or webauthn-register on a group of users. Each one sets up their second factor the next time they sign in, without a separate enrollment page in your app.

After a password leak

Set UPDATE_PASSWORD on the affected users and sign them out everywhere. Their next sign-in forces a new password.

Account settings in your app

A Change password or Set up passkey button in your app can be a kc_action link. Keycloak handles the form and the policy checks.

New terms

Enable TERMS_AND_CONDITIONS and set it on users who must accept a new version. The text comes from the login theme’s messages.

Setting actions through the admin API

Setting an action on a user is an update of the user. Emailing it sends the user a link that runs the actions when they open it.

Set an action, or email it
PUT /admin/realms/acme/users/<user-id>
{"requiredActions": ["UPDATE_PASSWORD"]}

PUT /admin/realms/acme/users/<user-id>/execute-actions-email
["UPDATE_PASSWORD", "VERIFY_EMAIL"]

The emailed link needs the realm’s email settings to work. The Admin API request builder writes both calls as curl, with the token step first.

Common problems and fixes

ProblemLikely causeFix
The action never showsIt is disabled in the realm.Enable it under Authentication, Required actions.
A kc_action link does not show the actionThe action cannot be started by an app, or the alias is misspelled.Check the alias, including case. Set it on the user instead.
Verify Email does nothingThe realm has no working email settings.Configure the realm’s email server and send a test message.
Delete Account is refusedThe user lacks the delete-account role of the account client.Enable the action and assign that role.

Security notes

  • Required actions run after the user signs in. They do not replace a second factor in the sign-in flow itself.
  • An emailed action link works for anyone who has the email. Keep its lifespan short with the admin-initiated action lifespan on the realm’s Tokens tab.
  • Temporary passwords set by an admin should always come with UPDATE_PASSWORD, which the console adds for you.
  • Turn on Delete Account only if you have a process for what happens to the user’s data in your own systems.

Best practices

  • Prefer setting actions on users for one-time changes, and kc_action for things users start themselves.
  • Keep update_user_locale enabled when the realm offers more than one language.
  • Test each action with a test user in a staging realm before you set it on real users.
  • When you set actions in bulk, do it in batches and watch login events for errors.
Questions

Frequently asked questions

What is a required action in Keycloak?

A step a user must complete before their sign-in finishes, such as updating a password or verifying an email address. Keycloak shows it after the user signs in and before it returns them to the app.

How do I force a user to change their password at next login?

Set the `UPDATE_PASSWORD` required action on the user, in the console or through the admin API. Setting a temporary password does the same thing automatically.

What is kc_action in Keycloak?

A parameter an app adds to the authorization request to ask for a required action during that sign-in, for example `kc_action=UPDATE_PASSWORD`. Keycloak shows the action and then returns to the app’s redirect URI.

How do I send a user an email to update their password?

Call `PUT /admin/realms/<realm>/users/<id>/execute-actions-email` with `["UPDATE_PASSWORD"]` as the body. The realm needs working email settings. The console has the same option on the user’s details.

How do I make every new user set up OTP?

Mark `CONFIGURE_TOTP` as a default action under Authentication, Required actions. New users then get it when they are created. Existing users need it set on them, or an OTP step in the sign-in flow.

Why is the Terms and Conditions page not showing?

The action is disabled by default. Enable it under Authentication, Required actions, then set it on users or make it a default action. The text comes from the login theme’s messages.

How do I let users delete their own account?

Enable the `delete_account` required action and give users the `delete-account` role of the `account` client. They can then delete their account from the account console or through `kc_action`.

Are required action aliases case-sensitive?

Yes. Use them exactly as Keycloak defines them: `UPDATE_PASSWORD` and `CONFIGURE_TOTP` are capitals, while `delete_account` and `webauthn-register` are lower case.

Rather not run Keycloak yourself?

We run it for you on a cluster of your own, with backups, upgrades and written support. Starter and Premium begin with a 7-day trial.