Keycloak authentication flow requirements
16 May 2025 (Updated 18 November 2025)
When you define an execution in Keycloak, you can set its Requirement type to one of four values:
- Required
- A
Requiredexecution must succeed otherwise the flow fails (i.e., you must callcontext.success()). - Keycloak always runs required executions.
- A
- Alternative
- An
Alternativestep is optional in that it doesn’t have to succeed for the flow to proceed. As long as another alternative step at the same level succeeds, the flow can proceed. - For example, if you have multiple
Alternativeexecutions at the same level, at least one of them must execute successfully for the flow to succeed. A successful execution is when you callcontext.success()orcontext.attempted(). - So if you have two
Alternativeflows and the firstAlternativeexecution succeeds, then the second one may not be run by Keycloak. If the first one fails, Keycloak will try the second one. If all alternative steps fail, the flow fails.
- An
- Conditional
- TODO
- Disabled
- Not active.
Tagged:
Keycloak