Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing data to ftl file #39

Open
htaimoor2010 opened this issue Oct 31, 2023 · 0 comments
Open

Passing data to ftl file #39

htaimoor2010 opened this issue Oct 31, 2023 · 0 comments

Comments

@htaimoor2010
Copy link

Hi,
I am integrating keycloak with my app. Due to some reason, I have to pass some custom parameters from query params to the register.ftl file. I have written a custom authenticator and have added it start of the registration flow so that I can access it before the register page is rendered. I have successfully extracted query param and now I want to use it in my register.ftl file.

I have added it in session attribute in authenticate method of my custom authenticator like this
context.getSession().setAttribute("patient_code","54321"); //for testing
And then tried to access it in ftl file like this:

Patient Code: ${attribute.patient_code}

But it is not working and I get error when register.ftl page is being rendered. The user is not created yet so cant use user attributes. I tried using context.getAuthenticationSession().setAuthNote but it didnt work either.

Is there any way I can achieve this? I may need to add some custom logic in authenticator and based on that, pass params to ftl, so I want to achieve it by passing from authenticator to ftl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant