-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
quarkus-keycloak-admin-client
throws UnrecognizedPropertyException
using Keycloak 20.0.0 and native image while getting ServerInfo
#29035
Comments
/cc @Karm, @galderz, @pedroigor, @sberyozkin, @zakkak |
quarkus-keycloak-admin-client
throws UnrecognizedPropertyException
using Keycloak 20.0.0 and native image while getting ServerInfo
We haven't worked on upgrading to KC 20.0.0 yet, so it is not really a bug, KC 19.0.3 clients are not expected to be forward compatible with higher versions of Keycloak |
Ignore my message please, it is a response from KC 20 which causes the problem
|
@michalvavrik Hi Michal, do you recall why we have both of
@SailReal Can you please try |
@sberyozkin AFAICT @gsmet added it. |
btw @sberyozkin I can have a look, but I bet you're already on it. |
@michalvavrik I'm not really on it yet, as I have a few PRs to look at. I think it is a general Jackson native issue at this point |
Okay, let me check. |
Yes, it looks like a reflection registration issue. @michalvavrik Please let me know if you need any help. |
@sberyozkin Yes, I'll check it and report back, takes some seconds to build 😅 |
|
Thanks @SailReal, looks like |
I don't agree with @sberyozkin, IMHO nothing to fix. Our Keycloak admin client is using If you change BOM Keycloak version to 20.0.0 and build One else thing, just because |
@michalvavrik Why would we want users mess with setting up Jackson just so that a JSON response containing a few unknown properties can be accepted ? This is just a basic interop concept, don't fail if some unknown properties in the response are available...
Why can't we have the right provider set for the non-reactive version as well ?
Does it not work correctly in the user reproducer ? |
Michal, IMHO we should move https://github.com/quarkusio/quarkus/blob/main/extensions/keycloak-admin-client-reactive/runtime/src/main/java/io/quarkus/keycloak/admin/client/reactive/runtime/ResteasyReactiveClientProvider.java into the existing common module (and I guess replacing thanks |
Or at least most of it as the abstract class as I see |
I agree it's inconsistent, but apart of import org.jboss.resteasy.reactive.client.impl.ClientBuilderImpl;
import org.jboss.resteasy.reactive.client.impl.WebTargetImpl;
import org.jboss.resteasy.reactive.server.jackson.JacksonBasicMessageBodyReader;
import io.quarkus.rest.client.reactive.jackson.runtime.serialisers.ClientJacksonMessageBodyWriter; Keycloak default version is using That said, I created my reproducer as I don't know |
|
Okay, now I reproduced it inside Quarkus app with my reproducer, I'll check next week why we don't use provided mapper. |
If I can do something to help please let me know. |
Thanks Michal @michalvavrik, looks like an interesting problem to explore but not urgent IMHO; we do recommend users to use reactive equivalents which works in this case. But it can be useful to see how to control Jackson better in the legacy scenarios as well, thanks. |
closes: quarkusio#29035 (cherry picked from commit 6851757)
Describe the bug
Using
quarkus-keycloak-admin-client
aKeycloak.getInstance(url, realm, username, password, clientId).serverInfo().getInfo().getSystemInfo().getVersion();
fails using Quarkus version 2.13.3.Final and Keycloak 20.0.0 using a native image due to aUnrecognizedPropertyException
of fieldcryptoInfo
.Expected behavior
quarkus-keycloak-admin-client
can be used together with Keycloak 20.0.0 and a native image to retrieve the system info as it works with a normal image.Actual behavior
How to Reproduce?
cd frontend && npm run dist
cd backend && mvn clean package -Pnative -Dquarkus.container-image.build=true -Dquarkus.native.container-build=true -Dquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-mandrel:22.2-java17 -Dquarkus.container-image.tag=1.0.0-amd64
Uploading hub_1_0_0_amd64.yml…
Output of
uname -a
orver
No response
Output of
java -version
No response
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.13.0.Final and 2.13.3.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)mvn clean package -Pnative -Dquarkus.container-image.build=true -Dquarkus.native.container-build=true -Dquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-mandrel:22.2-java17 -Dquarkus.container-image.tag=1.0.0-amd64
Additional information
While debugging, we found out that
is now in the response from Keycloak 20.0.0 but wasn't in 19.x . In the normal image
quarkus-keycloak-admin-client
doesn't have a problem that this property was added but the native image does.Here is the full response of the SystemInfoResponse.json using Keycloak 20.0.0. And here is the repsonse of the SystemInfoResponse_KC_19_0_3.txt using Keycloak 19.0.3 without this
cryptoInfo
which works as expected.The text was updated successfully, but these errors were encountered: