Repository navigation
Replies: 3 comments 9 replies
|
|
Hi Nahuel! Using the Microprofile Rest Client is not possible in Keycloak SPIs, because the Fortunately there are other options:
Hope this helps! |
|
If you are running into the same issue and found this discussion, you can find a working code snippet using That code snippet works really well, and it allows to map the HTTP response to a Java POJO (or record) out of the box. I'll update my project to include a functional example (i.e., including a dummy HTTP service providing users, using Docker compose, etc.) in the near future. Having said that, I wish the Keycloak team could enable the official Quarkus HTTP client for devs to use from custom user federation code withouth. It would save us from writing some boilerplate code. |
Uh oh!
There was an error while loading. Please reload this page.
Hi guys!
I'm trying to use a REST client from a custom Keycloak SPI (I'm using Keycloak 25.0.1) but without any luck so far. I'd like to ask you if you could give me a clue on how to do it the right way.
I have these dependencies on my
pom.xml:And I declared my API as follows:
But I have no idea how to inject it or instantiate it. I tried using:
Either throws a
java.lang.ClassNotFoundException org.eclipse.microprofile.rest.client.RestClientBuilder.With the same configuration, I also tried the following:
But it throws
java.lang.ClassNotFoundException: Provider for jakarta.ws.rs.client.ClientBuilder cannot be found.Not sure which approach is the one I should take and documentation isn't clear (and it's outdated, at least Quarkus docs) and there isn't any example of how to use an HTTP client to communicate with a microservice.
I appreciate any clue on how to solve this issue, thanks!
All reactions