Attempting to setSingleAttribute with custom registration


Ive taken the following code as the basis for a custom registration module (keycloak/ at main · keycloak/keycloak · GitHub) and have amended as follows;


        user.setSingleAttribute("bespoke", "value");
        context.getAuthenticationSession().setClientNote(OIDCLoginProtocol.LOGIN_HINT_PARAM, username);

What I’m trying achieve is to set a user attribute “bespoke” - the code seems to run ok, but when I check the user’s attributes nothing has been populated.

Any ideas what am I missing?

Hi @tropas2001 , I have your same issue on a keycloak 16.1.1

I’m trying to use this spi.
The code runs without errors but Keycloak doesn’t save the user attribute on the user profile.

Have you resolved your issue?