๐คTaking ownership of the kcContext
This documentation explore how to finely controlls what is and isnt included in the window.kcContext
object.
If you simply want to remove some specific values from the kcContext you can use the kcContextExclusionFtl option.
Some values, like for example the realm attributes (kcContext.realm.attributes) are explicitely excluded from the KcContext.
In the following video we explore how to include them back.
Note that in the video we includes all the realm attributes. We might want to expose only a specific set of values. For this we could do:
We could also chose to include only the realm attributes with a specific prefix, for example theme_
:
Setting up patch-package
As explained in the video:
Add patch-package add dev dependency
Edit the FreeMarker template that generates the KcContext in:
node_modules/keycloakify/src/bin/keycloakify/generateFtl/kcContextDeclarationTemplate.ftl
You can then create a diff for your changes by running:
Then add a postinstall script to your package.json:
Commit the patch/ directory that have been created by patch-package.