[keycloak-user] Admin Client cannot access keycloak

Denny Israel denny.israel at googlemail.com
Thu May 18 05:30:57 EDT 2017


I just realized that i was using the wrong jackson provider. Had to change
'resteasy-jackson-provider' for 'resteasy-jackson2-provider' and now it
works. Sorry for the premature alarm ;-)

2017-05-18 11:27 GMT+02:00 Denny Israel <denny.israel at googlemail.com>:

> Hi,
>
> i am trying to use the java keycloak-admin-client to access my keycloak
> server.
>
> Dependencies:
> compile group: 'org.jboss.resteasy', name: 'resteasy-jackson-provider',
> version: '3.1.2.Final'
> compile group: 'org.jboss.resteasy', name: 'resteasy-multipart-provider',
> version: '3.1.2.Final'
> compile group: 'org.jboss.resteasy', name: 'resteasy-client', version:
> '3.1.2.Final'
> compile group: 'org.keycloak', name: 'keycloak-admin-client', version:
> '3.1.0.Final'
>
> When i use the client to get the server info i get this exception:
> Exception in thread "main" javax.ws.rs.client.ResponseProcessingException:
> javax.ws.rs.ProcessingException: org.codehaus.jackson.map.exc.UnrecognizedPropertyException:
> Unrecognized field "access_token" (Class org.keycloak.representations.AccessTokenResponse),
> not marked as ignorable
>  at [Source: org.apache.http.conn.EofSensorInputStream at 68e5eea7; line: 1,
> column: 18] (through reference chain: org.keycloak.representations.
> AccessTokenResponse["access_token"])
>
> Here is my code:
>
> Keycloak kc = KeycloakBuilder.builder()
>         .serverUrl("http://<mykeycloak>/auth")
>         .realm("master")
>         .username("admin")
>         .password("admin")
>         .clientId("admin-cli")
>         .resteasyClient(
>                 new ResteasyClientBuilder().connectionPoolSize(10).build()
>         ).build();
> System.out.println(kc.serverInfo().getInfo());
>
> What am i doing wrong?
>


More information about the keycloak-user mailing list