Keycloak registration with code verification (through email)

Hello folks, Good to start with Keycloak. I’m fairly new to Keycloak and have got a use case where we need to change / modify the Keycloak user registration flow to include a step that does code verification sent through email.

Here’s the expected flow -

  1. Initially, when the form loads, the except email field, all other fields of registration form should be disabled or hidden.
  2. There needs to be setup (a mini form) with a label, input text to enter code and two buttons - Send Verification Code and Verify Code, which will send code to email and verify the code, probably I guess the form actions.
  3. Once verified the code, user should see remaining fields of registration - firstname, lastname, password etc. to fill in and continue registration.
  4. Since email is verified, the registration process would mark user email as verified in the flow and may not require action - Verify Email.

So the goal is to get this mini code verification form integrated into register.ftl and the flow. My guess this will require custom SPIs to be developed.

I have been reading implementing FormActions, FormAuthenticator however, kinda got lost or able to connect, so any help or advice or direction would be appreciated.

Thanks!

If you are using user federation, why you use Keycloak registration page?
I mean if user federation is implemented, you are not going to create user in Keycloak right? So you will handle user credentials check in your service?

we are not using user federation. This custom registration is for local accounts or Keycloak user accounts.