2025-06-27 09:31:56 +00:00
|
|
|
# keycloak-webjar-provider
|
|
|
|
|
2025-06-27 12:16:40 +02:00
|
|
|
Keycloak Provider for serving static assets from Webjars
|
|
|
|
|
|
|
|
## How to use Webjars in your theme
|
|
|
|
|
|
|
|
1. Download the Webjar you need in your theme from the internet and place the JAR (and its dependencies) in the
|
|
|
|
Keycloak <code>/opt/keycloak/providers</code> folder
|
|
|
|
2. Easiest way to download is to use Gradle/Maven (See build.gradle composeProviders task in this project)
|
|
|
|
3. In your Keycloak theme add a reference to the css and script files you want to include:
|
|
|
|
<pre>
|
|
|
|
//theme.properties
|
|
|
|
styles=webjars/uikit/3.17.9/css/uikit.min.css
|
|
|
|
scripts=webjars/htmx.org/1.9.2/dist/htmx.min.js
|
|
|
|
</pre>
|
|
|
|
4. These static assets will then automatically be loaded for your theme
|
|
|
|
|
|
|
|
|
|
|
|
## How to build this provider
|
|
|
|
|
|
|
|
To use this provider in Keycloak run the following command:
|
|
|
|
|
|
|
|
Unix/Mac: `./gradlew jar`
|
|
|
|
Windows: `gradlew.bat jar`
|
|
|
|
|
|
|
|
The copy the jar from `build/libs/` folder into your Keycloak `/opt/keycloak/providers` folder and restart Keycloak.
|