ilhan
ilhan

Reputation: 8963

Is it possible to add custom GET parameters in Keycloak registration page

I have created a custom field in Keycloak registration form that I can fill it automatically with a JavaScript code that takes it from the GET parameter in the url. But when I add a custom GET parameter (custom_field) to the url Keycloak redirects the page to same page without my custom parameter. Thus I cannot fill my custom field in the form. Is there a proper way to keep my custom GET parameter (custom_field=123) in the url?

http://localhost:8080/auth/realms/test/login-actions/registration?execution=89da4c86-6ad0-4412-b147-d8f8e5167404&client_id=account&tab_id=vWCVOB4V14E&custom_field=123

Upvotes: 9

Views: 2341

Answers (1)

Marius
Marius

Reputation: 101

The URL in your example contains an UUID which is valid only once, thus there is a reload of the page.

I was successful using a registration URL like this:

https://<your_host>/auth/realms/<your_realm>/protocol/openid-connect/registrations?client_id=<your_client>&response_type=code&scope=openid%20email&redirect_uri=<your_host>

Btw. some GET parameter names are not permitted, e.g. the name "ref" seems to be reserved.

Upvotes: 0

Related Questions