[keycloak-user] Java admin clients
Thomas Darimont
thomas.darimont at googlemail.com
Mon Sep 4 07:48:33 EDT 2017
Did you see this Keycloak Blog-Post [0] about using Swagger to generate
Docs for Keycloaks REST API?
Btw. another way I found to generate Swagger API documentation was using
jax-rs analyzer [1]
which can analyze the bytecode of keycloak-services-xxx.jar to generate the
API docs.
Cheers,
Thomas
[0]
http://blog.keycloak.org/2015/09/having-fun-with-rest-api-documentation.html
[1] https://github.com/sdaschner/jaxrs-analyzer
2017-09-04 13:27 GMT+02:00 Gaétan Collaud <gaetancollaud at gmail.com>:
> I successfully use the admin-client with this in my pom :
>
> <dependency>
> <groupId>org.keycloak</groupId>
> <artifactId>keycloak-admin-client</artifactId>
> <version>3.2.1.Final</version>
> </dependency>
> <dependency>
> <groupId>org.jboss.resteasy</groupId>
> <artifactId>resteasy-jaxrs</artifactId>
> <version>3.1.4.Final</version>
> </dependency>
> <dependency>
> <groupId>org.jboss.resteasy</groupId>
> <artifactId>resteasy-client</artifactId>
> <version>3.1.4.Final</version>
> </dependency>
> <dependency>
> <groupId>org.jboss.resteasy</groupId>
> <artifactId>resteasy-jackson2-provider</artifactId>
> <version>3.1.4.Final</version>
> </dependency>
>
> Le lun. 4 sept. 2017 à 12:37, christian lutz <christianlutz at inovel.de> a
> écrit :
>
> > Hello James,
> >
> > please see this pom file.
> > https://github.com/ChristianLutz/keycloak-cxf-
> admin-client/blob/master/pom.xml
> > We created our own cxf-admin-client because we rely on cxf.
> >
> > So just ignore our cxf dependencies and replace them with the resteasy
> > dependency. And you should be fine for compiling.
> > And these are the runtime dependency. Maybe one or another isn't
> necessary
> > anymore.
> >
> > <feature name="keycloak-adapter" version="${keycloak.version}">
> > <details>The keycloak adapter core stuff</details>
> > <feature version="[3,5)">http-whiteboard</feature>
> > <bundle>mvn:org.bouncycastle/
> bcprov-jdk15on/1.52</bundle>
> > <bundle>mvn:org.bouncycastle/
> bcpkix-jdk15on/1.52</bundle>
> >
> > <bundle>mvn:com.fasterxml.jackson.core/jackson-core/${
> jackson-version}</bundle>
> >
> > <bundle>mvn:com.fasterxml.jackson.core/jackson-
> annotations/${jackson-version}</bundle>
> >
> > <bundle>mvn:com.fasterxml.jackson.core/jackson-databind/
> ${jackson-version}</bundle>
> >
> > <bundle>mvn:com.fasterxml.jackson.module/jackson-module-
> jaxb-annotations/${jackson-version}</bundle>
> >
> > <bundle>mvn:org.jboss.logging/jboss-logging/3.3.0.Final</bundle>
> >
> > <bundle>mvn:org.keycloak/keycloak-osgi-thirdparty/${
> keycloak.version}</bundle>
> >
> > <bundle>mvn:org.keycloak/keycloak-common/${keycloak.version}</bundle>
> >
> > <bundle>mvn:org.keycloak/keycloak-core/${keycloak.version}</bundle>
> >
> > <bundle>mvn:org.keycloak/keycloak-cxf-admin-client/${
> keycloak.version}</bundle>
> > //replace it with your default resteasy dependency.
> >
> > <bundle>mvn:org.keycloak/keycloak-authz-client/${
> keycloak.version}</bundle>
> >
> > <bundle>mvn:org.keycloak/keycloak-adapter-spi/${
> keycloak.version}</bundle>
> >
> > <bundle>mvn:org.keycloak/keycloak-adapter-core/${
> keycloak.version}</bundle>
> >
> > <bundle>mvn:org.keycloak/keycloak-osgi-adapter/${
> keycloak.version}</bundle>
> > </feature>
> >
> > Hope this may help a bit.
> > Kind regards.
> > Christian
> >
> >
> >
> >
> >
> > -------- Original Message --------
> > Subject: [keycloak-user] Java admin clients (4. September 2017, 12:13)
> > From: James Green <james.mk.green at gmail.com>
> > To: christianlutz at inovel.de
> >
> > > In the absence of a Swagger endpoint (which would be so useful!) I've
> > been
> > > trying to use the admin-client in my client, but I cannot get even this
> > to
> > > work.
> > >
> > > It seems it requires an older version of Resteasy, which I downgrade
> to,
> > > then find I need to upgrade Jackson, then discover there are binary API
> > > changes preventing it's use presumably with keycloak-3.
> > >
> > > So I switched to OpenFeign and hooked in the JAXRS contracts feature,
> but
> > > this blows up because various methods of the various interfaces lack
> HTTP
> > > methods see UsersResource#get()
> > >
> > > So all-in-all, I'm not having any luck with something that looks like
> an
> > > off-the-shelf dependency to just "use" :(
> > >
> > > I've followed through a number of the example gists on Github but they
> > all
> > > seem to pre-date Keycloak-3 and don't work.
> > >
> > > The keycloak-admin-client doesn't seem to have any tests to confirm it
> > > actually works, either. So does anyone have a way forward without me
> > having
> > > to re-implement the interfaces?
> > >
> > > What I'd *really* like to see is a Swagger endpoint that I can point
> > > swagger-codegen at as we've had success though this means with other
> > > software in the past, but I can't find anything other than requests for
> > > Swagger in past emails to this list.
> > >
> > > Yours rather frustrated,
> > >
> > > James
> > > _______________________________________________
> > > keycloak-user mailing list
> > > keycloak-user at lists.jboss.org
> > > https://lists.jboss.org/mailman/listinfo/keycloak-user
> >
> >
> > To: james.mk.green at gmail.com
> > keycloak-user at lists.jboss.org
> >
> >
> > _______________________________________________
> > keycloak-user mailing list
> > keycloak-user at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/keycloak-user
> >
> _______________________________________________
> keycloak-user mailing list
> keycloak-user at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-user
>
More information about the keycloak-user
mailing list