[keycloak-user] Prefill Custom Attribute for User

Dmitry Telegin dt at acutus.pro
Wed Nov 21 18:38:12 EST 2018


Hello Betty,

Please also check these out:
http://lists.jboss.org/pipermail/keycloak-user/2018-November/016390.html
http://lists.jboss.org/pipermail/keycloak-user/2018-November/016383.html
http://lists.jboss.org/pipermail/keycloak-user/2018-November/016228.html

Yes, the similar problems have already popped up at least three times during November only (!), let alone earlier postings. I think it deserves a streamlined solution, so I'll probably post this to keycloak-dev ML. After all, Keycloak already does the same for kc_idp_hint URL parameter, why not doing this for all the kc_* params?

At the moment, there are at least three known workarounds:
1. fish the param out of URL or Referer header (depending on the context) and attach it to user session in Keycloak (search for "user session notes");
2. use JAX-RS interceptor on the protocol endpoint + plain HTTP session for the same;
3. use browser local storage and custom JavaScript injected into login / registration forms.

I'll put everybody in CC: when posting to the dev ML. Good luck and stay tuned,
Dmitry Telegin
CTO, Acutus s.r.o.
Keycloak Consulting and Training

Pod lipami street 339/52, 130 00 Prague 3, Czech Republic
+42 (022) 888-30-71
E-mail: info at acutus.pro

On Wed, 2018-11-21 at 20:28 +0000, Louie, Betty wrote:
> Hi All,
> 
> I’m trying to pass along a value to be set as a custom attribute on the user when they register for a keycloak account. I was trying to implement something along the lines of this http://lists.jboss.org/pipermail/keycloak-user/2018-May/013874.html where the value gets passed along as a query param and I grab the value from the query string and set it as a user attribute in a script. This isn’t reliable because if the registration form doesn’t pass the necessary validation, the page is refreshed and the query parameters are removed from the url.
> 
> I was wondering if anyone else has needed to pass along a value to be prefilled on the registration form and how you were able to get around it or if there is another way to keep hold of some value before and after the user registers for an account.
> 
> Thanks,
> Betty
> _______________________________________________
> keycloak-user mailing list
> keycloak-user at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-user


More information about the keycloak-user mailing list