adorsys / keycloak-config-cli

Import YAML/JSON-formatted configuration files into Keycloak - Configuration as Code for Keycloak.
Apache License 2.0
778 stars 140 forks source link

Keycloak 23.x - keycloak-config-cli version 5.10.0 incompatibility #973

Closed subft1 closed 9 months ago

subft1 commented 10 months ago

Current Behavior

When using image quay.io/adorsys/keycloak-config-cli:5.10.0-22.0.4 it is not possible to import due to following error.

keycloak-idp-kc-1 | 2023-12-20 07:11:13.172 INFO 273 --- [ main] d.a.k.config.KeycloakConfigRunner : Importing file 'file:/opt/keycloak/conf/config/00_realm.json' keycloak-idp-kc-1 | 2023-12-20 07:11:14,471 INFO [io.quarkus.http.access-log] (executor-thread-1) 127.0.0.1 - - [20/Dec/2023:07:11:14 +0000] "POST /realms/master/protocol/openid-connect/token HTTP/1.1" 200 1822 keycloak-idp-kc-1 | 2023-12-20 07:11:14,683 INFO [io.quarkus.http.access-log] (executor-thread-1) 127.0.0.1 - - [20/Dec/2023:07:11:14 +0000] "GET /admin/serverinfo HTTP/1.1" 200 274656 keycloak-idp-kc-1 | 2023-12-20 07:11:14.741 ERROR 273 --- [ main] d.a.k.config.KeycloakConfigRunner : jakarta.ws.rs.ProcessingException: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "required" (class org.keycloak.representations.idm.ConfigPropertyRepresentation), not marked as ignorable (8 known properties: "defaultValue", "readOnly", "label", "type", "name", "helpText", "secret", "options"]) keycloak-idp-kc-1 | at [Source: (org.jboss.resteasy.specimpl.AbstractBuiltResponse$InputStreamWrapper); line: 1, column: 30597] (through reference chain: org.keycloak.representations.info.ServerInfoRepresentation["protocolMapperTypes"]->java.util.LinkedHashMap["saml"]->java.util.ArrayList[0]->org.keycloak.representations.idm.ProtocolMapperTypeRepresentation["properties"]->java.util.ArrayList[0]->org.keycloak.representations.idm.ConfigPropertyRepresentation["required"]) keycloak-idp-kc-1 | 2023-12-20 07:11:14.741 INFO 273 --- [ main] d.a.k.config.KeycloakConfigRunner : keycloak-config-cli running in 00:01.910.

I used the jar file from within the image (version 5.10.0) and tried to do the import using the jar directly.

When using version 5.10.1-SNAPSHOT the import is working fine.

Expected Behavior

Import should work without getting exception when using keycloak version 23.x

Steps To Reproduce

1. Use keycloak 23.x and use keycloak-config-cli version 5.10.0 
2. Exception will occur
3. Use keycloak 23.x und use keycloak-config-cli version 5.10.1-SNAPSHOT
4. No exception

Environment

Anything else?

No response

chao-shawn commented 9 months ago

I'm having the same problem as well. Where can I find the 5.10.1-SNAPSHOT .jar or Docker image?

subft1 commented 9 months ago

I'm having the same problem as well. Where can I find the 5.10.1-SNAPSHOT .jar or Docker image?

check out the repo and build it

jonasvoelcker commented 9 months ago

Hey @subft1,

did you try this image? 5.10.0-23.0.1

We had some breaking changes when Keycloak 23 showed up, this required-flag is one of those 😉

Best Regard Jonas

subft1 commented 9 months ago

Thx Jonas,

didn't check for that version 5.10.0-23.0.1.

It's working