Provides Password Policy data as well as Realm attribute access to your Keycloak FreeMarker templates.
The Password Policy data is available in the passwordPolicies
object.
The following properties are available:
length
: The minimum length of the passwordmaxLength
: The maximum length of the passworddigits
: The minimum number of digits required in the passwordlowerCase
: The minimum number of lowercase characters required in the passwordupperCase
: The minimum number of uppercase characters required in the passwordspecialChars
: The minimum number of special characters required in the passwordnotUsername
: Whether the password can contain the usernamenotEmail
: Whether the password can contain the email addresspasswordHistory
: The number of previous passwords that cannot be reusedforceExpiredPasswordChange
: The number of days before the password expires
The Realm attributes are available in the realmAttributes
object.
This is useful
for storing information about your Realm instance that you want to display in your templates.
For example,
you could store the name of your organization in a Realm attribute and display it in your templates.
- Download the latest release from the releases page and place it in the
$KEYCLOAK_HOME/providers
directory of your Keycloak installation. - Run the following command to build the providers into Keycloak:
$KEYCLOAK_HOME/bin/kc.sh build
- Start Keycloak
-
Create a Dockerfile with the following contents (or use the
Dockefile.dev
file in this repository):FROM maven:3-amazoncorretto-17 AS extensions WORKDIR /app COPY pom.xml . COPY src src RUN mvn package FROM quay.io/keycloak/keycloak:23.0 AS builder # Install any custom providers here COPY --from=extensions /app/target/keycloak-theme-additional-info-extension.jar /opt/keycloak/providers/ RUN /opt/keycloak/bin/kc.sh build FROM quay.io/keycloak/keycloak:23.0 COPY --from=builder /opt/keycloak/ /opt/keycloak/ ENTRYPOINT ["/opt/keycloak/bin/kc.sh"]
-
Build the Docker image:
docker build -t keycloak-theme-additional-info-extension .
-
Run the Docker image:
docker run -p 8080:8080 keycloak-theme-additional-info-extension start-dev
- Create a Dockerfile with the following contents:
FROM quay.io/keycloak/keycloak:23.0 COPY --from=ghcr.io/jcputney/keycloak-theme-additional-info-extension:latest /app/keycloak-theme-additional-info-extension.jar /opt/keycloak/providers/ RUN /opt/keycloak/bin/kc.sh build ENTRYPOINT ["/opt/keycloak/bin/kc.sh"]
- Build the Docker image:
docker build -t keycloak-theme-additional-info-extension .
- Run the Docker image:
docker run -p 8080:8080 keycloak-theme-additional-info-extension start-dev