Customizing user attributes in version 24.0.4

Hi keycloak users,

I’m trying to build a user attribute in the user profile section. I am able to create a dropdown with 2 to 3 values by default.
options : { “options”:: [1,2,3] }

This values might change in future, so I need to fetch the dropdown dynamically either from the database or an exposed external API.
I might need a help here to create custom UpConfig adapter to replace those values or is there a better way to do this?

I’ve attempted to customize this by creating a custom UserProfile provider, but I haven’t been successful so far. However, it seems that these forms are quite flexible and customizable. I’m curious if anyone else has had success with this. Any assistance in this matter would be greatly appreciated :).

So, I’ve tried to extend this class DeclarativeUserProfileProvider and implemented this interface UserProfileProvider. By overriding getConfiguration(), I can able to achieve this by calling my external API.

But is this the correct way of doing it?