Adding User Profile feature to Keycloak 4.3

We’re running Keycloak 4.3 on our servers. We need to disable updating (editing) first name and last name fields in account page (I disabled these fields in account UI, but when click on submit I get error that says: Please specify first name / last name). I saw that from Keycloak 14 and above, User profile feature has been added which helps to manage user profile attributes like allowing the user to be able to edit these fields or not. I want to know is there a way to add this feature to Kecyloak 4.3 or not? If yes, would you please guide me how to do it?
Also I read this thread but I didn’t get how I can disable validation of these two fields in the Keycloak server. If the above approach (Adding User Profile feature) is not possible, would you give me a better insight how to do this one (with an example code will be more helpful)?

Hi,

you can get an example on how to disable this in the example on keycloak-extensions/spi-registration-profile at master · zonaut/keycloak-extensions · GitHub
It’s possible you need to look somewhat deeper which class but it points you in the right direction at least, hopefully.

Hi @zonaut,
First, thank you for providing an example for this feature for the community. I’ve checked this example which is for registration page. I got to your GitHub repo following this thread. But I think we have some differences between registration flow and account flow which made me confused how to apply those changes in your code for the account page. If I’m correct, you mentioned here that AccountFormService is not a SPI while registration flow is a SPI. I’m new to Keycloak and I don’t have any insights how to implement such a thing for profile account flow. Would you please give me more hints?