Skip to content

mangadex-pub/keycloak-bcrypt

 
 

Repository files navigation

Keycloak BCrypt

Add a password hash provider to handle BCrypt passwords inside Keycloak.

Build JAR

./gradlew assemble -Pdependency.keycloak.version=${KEYCLOAK_VERSION}

Build Docker image

cp build/libs/keycloak-bcrypt-${KEYCLOAK_BCRYPT_VERSION}.jar docker
docker build \
    --build-arg keycloak_version=${KEYCLOAK_VERSION} \
    --build-arg keycloak_bcrypt_version=${KEYCLOAK_BCRYPT_VERSION} \
    -t gleroy/keycloak-bcrypt \
    docker

Test with docker-compose

docker-compose up -d

Install

>= 17.0.0

curl -L https://github.com/leroyguillaume/keycloak-bcrypt/releases/download/${KEYCLOAK_BCRYPT_VERSION}/keycloak-bcrypt-${KEYCLOAK_BCRYPT_VERSION}.jar > ${KEYCLOAK_HOME}/providers/keycloak-bcrypt-${KEYCLOAK_BCRYPT_VERSION}.jar

You need to restart Keycloak.

< 17.0.0

curl -L https://github.com/leroyguillaume/keycloak-bcrypt/releases/download/${KEYCLOAK_BCRYPT_VERSION}/keycloak-bcrypt-${KEYCLOAK_BCRYPT_VERSION}.jar > ${KEYCLOAK_HOME}/standalone/deployments/keycloak-bcrypt-${KEYCLOAK_BCRYPT_VERSION}.jar

You need to restart Keycloak.

Run with Docker

docker run \
    -e KEYCLOAK_ADMIN=${KEYCLOAK_ADMIN} \
    -e KEYCLOAK_ADMIN_PASSWORD=${KEYCLOAK_ADMIN_PASSWORD} \
    -e KC_HOSTNAME=${KC_HOSTNAME} \
    gleroy/keycloak-bcrypt \
    start

The image is based on Keycloak official one.

How to use

Go to Authentication / Password policy and add hashing algorithm policy with value bcrypt.

To test if installation works, create new user and set its credentials.

About

BCrypt password provider in Keycloak

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 75.1%
  • Kotlin 24.9%