keycloak themes in react
installation:
npm i -g ts-node
required to generate client tsx
the following script is intended to create a temporary keycloak container. not meant to maintain any persistance as we are only testing the themes. keycloak will be started with an example
realm which is where theme testing should be contained. username and password is admin
/ admin
.
./tools/docker/launch.sh
# run as needed after making theme updates
./tools/docker/writeTheme.sh
file generation:
- download assets and place in
tools/generator/assets
with{client}/*
format - run
npm run generate
orts-node --compiler-options "{\"module\":\"commonjs\"}" tools/generator
to generate ts files
when clients have been configured on keycloak instance:
- go to https://www.keycloak.org/app/ . Click "Save" and then "Sign in".
when ready to deploy, run: npm run keycloak
. this will create a .jar
file (build_keycloak/target/keycloakify-keycloak-theme-1.0.0.jar) which will need to be added to your keycloak's theme directory.
- This may be required in your .env
IMAGE_INLINE_SIZE_LIMIT=10
due to react-scripts setting a default maximum size limit when building for production. Found from their webpack.config.js file. - ts-node must be ran with
--compiler-options "{\"module\":\"commonjs\"}"
when generating ts files as nextjs is rewriting module to esnext node-sass
was replaced withsass
as m1 mac was not supported and ran into installation issues