How to have registration page appart of login page?

Hi Everyone,

I would like to know if it’s possible to have a Registration Page appart of the Login Page. I mean for one realm, If i want to enable Registration I don’t want it to be a link below login form but another form on the left. I’m pretty sure it’s linked to custom therme but I don’t really understand how to do that ?
Thank you in advance,

Regards,

Dan

Hello Daloulou,

Effectivly you need to develop a custom theme which aggregate the login and the registration page. You can find each page template into the keycloak installation (under themes/base/login - register.ftl and login.ftl). Your new page must handle to different forms targeting the login and registration url (see action attribute in each original ftl)

For theme development, you can find documentation here : https://www.keycloak.org/docs/latest/server_development/#_themes

1 Like

Hello M3Ikior,

My requirement has slight difference. I have registration button at my Homepage. On click of Registration button, I would like to directly redirect to registration page.

Also, I have profile base application. For that, i would like to implement functionality that after successful login i want to redirect to specific page(page are dynamic i.e. User Profile) of my application.

Could you please provide me some information regarding my requirement. I am beginner for Keycloak.

Environment: Keycloak vrsion(10.0.0), Using my own custom theme

Your small help will be much appreciated.

Regards,
Parth

Hi, I have same question than @daloulou, I would like to have the registration page out side keycloak(because we already have it), Could you please indicate how we should configure keyclaok to be able to get redirect to the registration page.

Thanks in advance for your support.

Keycloak supports both OpenID Connect (an extension to OAuth 2.0) and SAML 2.0. When securing clients and services the first thing you need to decide is which of the two you are going to use. If you want you can also choose to secure some with OpenID Connect and others with SAML.

See: Securing Applications and Services Guide

Hi @M3lkior,

Thanks for your previous help, it helped me a lot. I would like to know if there is a way to split my form in different Part. For example, before redirecting to registration_url i would like to have another form that will call an external api to pre-fill the registration-form only after this API call I would like to redirect on registration URL.
Thanks

Hi, did you consider using the Keycloak Admin Rest API from your app to create (manage) the user in Keycloak? That is pretty straightforward, when your registrations questions are done you create the user object in Keycloak and let Keycloak send out the email address verification email. This also leads to setting the password - and your app has no need to know the password of the user.

1 Like

@vju42 How can i do that when registration form are managed by Keycloak ?

Ok… in Keycloak admin disable registration so that users are no longer offered to self-register.
This is important to ensure that a user who „finds“ your IDP is not able to register „via“ IDP.
Instead, on your „own“ app that has an anonymous part you offer a „register“ link (i think you said you have your own registration page(s) already).

So this approach would take Keycloak out of the game for registration and make your app responsible.
For sure there are other options but this is what comes to my mind based on your question.

Makes sense?

1 Like

yes i understand, thanks but i would like to manage this through Keycloak Backend if it’s possible

Ok sorry - i responded to @ducoudray who asked for this. The forum does not show the hierarchy as I expected.
For the Keycloak registration procedure, there is an example on https://www.keycloak.org/docs/latest/server_development/index.html#_custom_user_attributes
I have used this previously, it worked fine. I believe you know this one and have extended requirements not met?

Hi @vju42, thanks for take the time and respond my question, I appreciate.

I will take a look on the registration API from keycloak, I think yes is pretty straight forwards.