Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Keycloak theme variables

Tags:

In the base templates of the Keycloak there are multiple examples of variables, that are accessed in the Freemarker Templates. For example, in the file: https://github.com/keycloak/keycloak/blob/master/themes/src/main/resources/theme/base/login/login.ftl

There are fields:

properties.kcFormGroupClass

realm.rememberMe

url.registrationUrl

Where are those hashes defined? The only thing I found in the documentation was that I can access:

${some.system.property} - for system properties

${env.ENV_VAR} - for environment variables

but I cannot find f.e. url options. I would like to display the address that the user tries to access.

like image 378
JoshThunar Avatar asked May 10 '20 23:05

JoshThunar


1 Answers

All this entities is as instances of Java Classes that was provided for Freemarker template engine during page rendering. You can search for corresponding classes in keycloak github repo. Usually they all named like %Something%Bean e.g. LoginBean, ClientBean, UrlBean.

look here: https://github.com/keycloak/keycloak/blob/10.0.1/services/src/main/java/org/keycloak/forms/login/freemarker/model/RealmBean.java

like image 196
solveMe Avatar answered Sep 18 '22 13:09

solveMe