From fae333750a8d2ef8b0577f5770a75cead795f565 Mon Sep 17 00:00:00 2001 From: stianst Date: Thu, 5 Mar 2020 11:31:43 +0100 Subject: [PATCH] KEYCLOAK-10330 Force Jackson2 provider to be used by Keycloak admin client, to prevent json-b provider taking over --- .../java/org/keycloak/admin/client/JacksonProvider.java | 6 ++++++ .../src/main/java/org/keycloak/admin/client/Keycloak.java | 2 ++ 2 files changed, 8 insertions(+) create mode 100644 integration/admin-client/src/main/java/org/keycloak/admin/client/JacksonProvider.java diff --git a/integration/admin-client/src/main/java/org/keycloak/admin/client/JacksonProvider.java b/integration/admin-client/src/main/java/org/keycloak/admin/client/JacksonProvider.java new file mode 100644 index 0000000000..58317b9bac --- /dev/null +++ b/integration/admin-client/src/main/java/org/keycloak/admin/client/JacksonProvider.java @@ -0,0 +1,6 @@ +package org.keycloak.admin.client; + +import org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider; + +public class JacksonProvider extends ResteasyJackson2Provider { +} diff --git a/integration/admin-client/src/main/java/org/keycloak/admin/client/Keycloak.java b/integration/admin-client/src/main/java/org/keycloak/admin/client/Keycloak.java index db73ea631c..779ff6de93 100755 --- a/integration/admin-client/src/main/java/org/keycloak/admin/client/Keycloak.java +++ b/integration/admin-client/src/main/java/org/keycloak/admin/client/Keycloak.java @@ -67,6 +67,8 @@ public class Keycloak implements AutoCloseable { if (customJacksonProvider != null) { clientBuilder.register(customJacksonProvider, 100); + } else { + clientBuilder.register(JacksonProvider.class, 100); } return clientBuilder.build();