Keycloak · Arazzo Workflow
Keycloak Onboard a User
Version 1.0.0
Provision a realm user, set an initial password, and grant a realm-level role.
View Spec
View on GitHub
AuthenticationAuthorizationIdentity ManagementOAuthOpenID ConnectSecuritySSOArazzoWorkflows
Provider
Workflows
onboard-user
Create a user in a realm, set an initial password, and assign a realm role.
Idempotently provisions a user account: reuses the account when the username already exists, otherwise creates it, then resolves the UUID, sets a temporary password, and grants the requested realm-level role.
1
confirmRealm
getRealm
Read the realm representation to confirm the realm exists and is enabled before attempting to write any users into it.
2
precheckUser
getUsers
Search the realm for an existing account with this username so the flow stays idempotent and never trips the 409 conflict on create.
3
createUserAccount
createUser
Create the enabled user account. Keycloak answers 201 with a Location header and no response body, so the UUID is resolved by the next step rather than read from this response.
4
resolveUserId
getUsers
Resolve the user UUID by searching the realm for the username. Both the created and the pre-existing branch converge here, because every dependent Keycloak call is keyed on the UUID rather than the username.
5
setInitialPassword
resetUserPassword
Set the account password. Marking the credential temporary forces a password change at first login, which is the expected onboarding posture.
6
resolveRole
getRole
Look up the realm-level role by name to obtain the id and name pair that the role-mapping endpoint requires in its request body.
7
assignRealmRole
addUserRealmRoleMappings
Grant the resolved realm-level role to the user. The body is an array of role representations, each requiring the id and name of the role.
8
verifyRoleMappings
getUserRealmRoleMappings
Read the user's realm-level role mappings back to prove the grant landed before the onboarding flow reports success.