Repository navigation
Verify phone number before user creation during registration #48655
Replies: 1 comment
|
Keycloak doesn't have built-in phone verification during registration out of the box. The registration flow only supports email verification natively. To get phone verification before user creation, you'd need a custom Required Action or a custom Authenticator in the registration flow. The general approach would be:
There are some community extensions that add phone/SMS support — If you don't want to deal with custom SPIs, another approach is to handle phone verification in your application layer before redirecting to Keycloak for registration. Less clean but avoids the KC customization. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hello. I need to verify the phone number entered by the user during registration by sending an SMS with a code to that number and having the user enter the code.
So, my only question is: How can I modify the standard registration flow so that the user account is created only after the phone number has been verified?
When I add a generic flow with my custom authenticator inside the form flow, I get a NPE (NullPointerException) with
providerId=null. But when I place my flow after the form flow, the user is already created, and I have to figure out a way to delete the created users. I also have to figure out what to do if that user decides to register again.In my system, all users must have a verified phone number.
Thanks.
All reactions