Not able to open keycloak Terms and conditions action before registration


I am working on Keycloak theme. Where we need the terms and conditions page before the Registration page.

as per the default setup terms and conditions action getting called after the .registration successful.
as per our project requirement we need the terms and conditions action before Registration page , If user accepts the terms then only able navigate to register otherwise user should be navigated back to login screen.

Is there any workaround to achieve this.


“Terms and Conditions” (Server Administration Guide) in Keycloak is implemented as a RequiredAction, which means it can only be displayed after a login (or successful registration) session. If you want to display your Terms and Conditions before a registration, you’ll have to override the default Registration Authentication flow.

Is there any documentation or reference links present which we can use to override the default registration Authentication flow?


There is information on how to extend the registration page here:

However, if you want to build the Terms and Conditions as a separate page, you’ll have to build a class that extends FormAuthenticator. See the RegistrationPage class for an example.