Post process authentication data

Hello.
There is requirement to add phone Number as prefix for enter password, because in old system the real password were saved as template phoneNumber+password.
We use spring boot and add keycloak as security authentication server. It redirects to keycloak page for entering login and password.
The idea is to store phone number to keycloak user details and add some provider which will read user details and add this prefix to entered password.
Is there opportunity to do that?
Thank you.