Password Policy export/import failed #29420
Labels
area/import-export
kind/bug
Categorizes a PR related to a bug
status/auto-expire
status/missing-information
team/core-iam
Before reporting an issue
Area
import-export
Describe the bug
After setting up password policy and exporting this to json, unable to start keycloak with import. Failed with the following:
ERROR: invalidPasswordMinSpecialCharsMessage
The line I have added to json import is the following:
"passwordPolicy": "length(8) and maxLength(64) and specialChars(1) and upperCase(1) and lowerCase(1) and digits(1) and notUsername(undefined) and notEmail(undefined)"
Version
24 and 23
Regression
Expected behavior
Import works and password policy implemented
Actual behavior
failed to start the server
How to Reproduce?
Run keycloak, create realm, add password policy with minimum chars required, export realm. Make docker compose file and add import file on start.
Anything else?
docker compose file:
keycloak:
image: quay.io/keycloak/keycloak:24.0.4
container_name: keycloak
environment:
KC_HEALTH_ENABLED: true
KC_METRICS_ENABLED: true
KC_DB_VENDOR: POSTGRES
KC_DB_ADDR: postgres
KC_DB_DATABASE: service_keycloak
KC_DB_PORT: 5432
KC_DB_USER: keycloak
KC_DB_PASSWORD: password
KEYCLOAK_ADMIN: admin
KEYCLOAK_ADMIN_PASSWORD: password
KEYCLOAK_IMPORT: /opt/keycloak/data/import/full-realm-export.json
KC_FEATURES: account-api,account2,account3
volumes:
- ./config/imports:/opt/keycloak/data/import
command:
- "start-dev"
- "-Dkeycloak.migration.action=import"
- "-Dkeycloak.migration.provider=singleFile"
- "-Dkeycloak.migration.strategy=OVERWRITE_EXISTING"
- "-Dkeycloak.migration.file=/opt/keycloak/data/import/full-realm-export.json"
ports:
- 8080:8080
The text was updated successfully, but these errors were encountered: