<div dir="ltr">I am using keycloak-admin-client jar for provisioning users  in keycloak server instance but facing issue if using keycloak-admin-client version higher than 1.8.0.Final. Please find detailed informations about issue and configurations used to provision user as below:<div><br></div><div>1) keycloak-server version: 1.9.8.Final or 2.0.0.Final</div><div>2) keycloak-admin-client version: 1.9.8.Final or 2.0.0.Final</div><div><br></div><div>Sample Code Snippet:</div><div><br></div><div><div>Keycloak kc = KeycloakBuilder.builder() //</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                                </span>.serverUrl(&quot;<a href="http://localhost:8080/auth">http://localhost:8080/auth</a>&quot;) //</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                                </span>.realm(&quot;master&quot;)//</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                                </span>.username(&quot;admin&quot;) //</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                                </span>.password(&quot;admin&quot;) //</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                                </span>.clientId(&quot;admin-cli&quot;) //</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                                </span>// .clientId(&quot;security-admin-console&quot;) //</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                                </span>.resteasyClient(new ResteasyClientBuilder().connectionPoolSize(10).build())//</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                                </span>.build();</div></div><div><div>// 1. User</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>CredentialRepresentation credential = new CredentialRepresentation();</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>credential.setType(CredentialRepresentation.PASSWORD);</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>credential.setValue(&quot;test123&quot;);</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>credential.setTemporary(false);</div><div><br></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>UserRepresentation user = new UserRepresentation();</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>user.setUsername(&quot;testuser&quot;);</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>user.setFirstName(&quot;Test&quot;);</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>user.setLastName(&quot;User&quot;);</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>user.setCredentials(asList(credential));</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>user.setEnabled(true);</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>user.setRealmRoles(asList(&quot;admin&quot;));</div><div><br></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>// create a user</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>//Response result = kc.realm(&quot;master&quot;).users().create(user);</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>Response result = kc.realm(&quot;demo&quot;).users().create(user);</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>if (result.getStatus() != 201) {</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                        </span>if(result.getStatus() == 409){</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                                </span>System.err.println(&quot;Couldn&#39;t create user since user already exist.&quot;);</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                                </span>System.exit(0);</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                        </span>}</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                        </span>System.err.println(&quot;Couldn&#39;t create user.&quot;);</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                        </span>System.exit(0);</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>}</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span>System.out.println(&quot;test user created.... verify in keycloak!&quot;);</div></div><div><br></div><div>Error stack trace::</div><div><br></div><div><div>Exception in thread &quot;main&quot; javax.ws.rs.client.ResponseProcessingException: javax.ws.rs.ProcessingException: org.codehaus.jackson.map.exc.UnrecognizedPropertyException: Unrecognized field &quot;access_token&quot; (Class org.keycloak.representations.AccessTokenResponse), not marked as ignorable</div><div> at [Source: org.apache.http.conn.EofSensorInputStream@6f3c660a; line: 1, column: 18] (through reference chain: org.keycloak.representations.AccessTokenResponse[&quot;access_token&quot;])</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.extractResult(ClientInvocation.java:140)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>at org.jboss.resteasy.client.jaxrs.internal.proxy.extractors.BodyEntityExtractor.extractEntity(BodyEntityExtractor.java:58)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>at org.jboss.resteasy.client.jaxrs.internal.proxy.ClientInvoker.invoke(ClientInvoker.java:104)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>at org.jboss.resteasy.client.jaxrs.internal.proxy.ClientProxy.invoke(ClientProxy.java:62)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>at com.sun.proxy.$Proxy19.grantToken(Unknown Source)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>at org.keycloak.admin.client.token.TokenManager.grantToken(TokenManager.java:85)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>at org.keycloak.admin.client.token.TokenManager.getAccessToken(TokenManager.java:65)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>at org.keycloak.admin.client.token.TokenManager.getAccessTokenString(TokenManager.java:60)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>at org.keycloak.admin.client.resource.BearerAuthFilter.filter(BearerAuthFilter.java:52)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.invoke(ClientInvocation.java:384)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>at org.jboss.resteasy.client.jaxrs.internal.proxy.ClientInvoker.invoke(ClientInvoker.java:102)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>at org.jboss.resteasy.client.jaxrs.internal.proxy.ClientProxy.invoke(ClientProxy.java:62)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>at com.sun.proxy.$Proxy27.create(Unknown Source)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>at com.samba.security.keycloak.KeycloakAdminClientExample.main(KeycloakAdminClientExample.java:79)</div><div>Caused by: javax.ws.rs.ProcessingException: org.codehaus.jackson.map.exc.UnrecognizedPropertyException: Unrecognized field &quot;access_token&quot; (Class org.keycloak.representations.AccessTokenResponse), not marked as ignorable</div><div> at [Source: org.apache.http.conn.EofSensorInputStream@6f3c660a; line: 1, column: 18] (through reference chain: org.keycloak.representations.AccessTokenResponse[&quot;access_token&quot;])</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>at org.jboss.resteasy.client.jaxrs.internal.ClientResponse.readFrom(ClientResponse.java:282)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>at org.jboss.resteasy.client.jaxrs.internal.ClientResponse.readEntity(ClientResponse.java:181)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>at org.jboss.resteasy.specimpl.BuiltResponse.readEntity(BuiltResponse.java:211)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.extractResult(ClientInvocation.java:104)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>... 13 more</div><div>Caused by: org.codehaus.jackson.map.exc.UnrecognizedPropertyException: Unrecognized field &quot;access_token&quot; (Class org.keycloak.representations.AccessTokenResponse), not marked as ignorable</div><div> at [Source: org.apache.http.conn.EofSensorInputStream@6f3c660a; line: 1, column: 18] (through reference chain: org.keycloak.representations.AccessTokenResponse[&quot;access_token&quot;])</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>at org.codehaus.jackson.map.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:53)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>at org.codehaus.jackson.map.deser.StdDeserializationContext.unknownFieldException(StdDeserializationContext.java:267)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>at org.codehaus.jackson.map.deser.std.StdDeserializer.reportUnknownProperty(StdDeserializer.java:673)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>at org.codehaus.jackson.map.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:659)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>at org.codehaus.jackson.map.deser.BeanDeserializer.handleUnknownProperty(BeanDeserializer.java:1365)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>at org.codehaus.jackson.map.deser.BeanDeserializer._handleUnknown(BeanDeserializer.java:725)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>at org.codehaus.jackson.map.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:703)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>at org.codehaus.jackson.map.deser.BeanDeserializer.deserialize(BeanDeserializer.java:580)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>at org.codehaus.jackson.map.ObjectMapper._readValue(ObjectMapper.java:2704)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>at org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:1315)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>at org.codehaus.jackson.jaxrs.JacksonJsonProvider.readFrom(JacksonJsonProvider.java:419)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.readFrom(AbstractReaderInterceptorContext.java:59)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.proceed(AbstractReaderInterceptorContext.java:51)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>at org.jboss.resteasy.plugins.interceptors.encoding.GZIPDecodingInterceptor.aroundReadFrom(GZIPDecodingInterceptor.java:59)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.proceed(AbstractReaderInterceptorContext.java:53)</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>at org.jboss.resteasy.client.jaxrs.internal.ClientResponse.readFrom(ClientResponse.java:248)</div></div><div><br></div><div>Same sample code with keycloak-admin-client version: 1.8.0 is working fine and able to provision user in keycloak server. Hence there is some issue with higher version of keycloak-client-admin bundle than 1.8.0. Please find attached pom file for project.</div><div><br></div><div>Thanks,</div><div>Jitendra Chouhan</div><div><br></div></div>