let searchParams = new URLSearchParams(window.location.search);
let param = searchParams.get('param');
document.getElementById('user.attributes.param').value = param;
For the case of user login with IDP, I still didn’t find any solution to store this param. The IDP doesn’t support any param to do it (the state param is already used by Keycloak). Therefore, I want to store the param before redirecting to IDP and retrieve it after the user login IDP successfully. But I still don’t find any solution for this idea. Does anyone have any idea about this issue?
It is possible to create a simple, custom Authenticator that stores the param as an Auth Note. You can then use this after the user returns from the IdP. More information on creating extensions is here Server Developer Guide
I create an authenticator and add the authenticator into the registration flow (I also add it into the browser/post login/first broker login,… flows) (I add the authenticator in the first step of each flow)
However, I only get the search param after the user login with IDP successfully (tab_id and client_id). I cannot get the param before redirecting to IDP.