Can't find documentation for quarkus-keycloak-admin-client
extension.
#26836
-
I tried looking for examples/documentation on keycloak admin client but there's nothing useful out there. Here's my example code. import org.keycloak.admin.client.Keycloak;
import org.keycloak.representations.idm.UserRepresentation;
@Path("/api/admin")
@Authenticated
@ApplicationScoped
public class AdminResource {
@Inject
Keycloak keycloak;
@GET
@Path("/users")
@Produces(MediaType.APPLICATION_JSON)
public List<UserRepresentation> getAllUsers() {
return keycloak.realm("quarkus").users().list();
}
} Edit: Code above is not running. Getting build errors. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
/cc @pedroigor, @sberyozkin |
Beta Was this translation helpful? Give feedback.
-
@omar-zahid This extension only exists to facilitate running Keycloak Admin Client in native mode, you just need to initialize
So the injection does not work. However, now that you've typed this code, I wonder if we can enhance this extension a bit and support this injection to simplify things... But until then - use this extension if you'd like to use the admin client, just don't expect the injection working just yet |
Beta Was this translation helpful? Give feedback.
@omar-zahid This extension only exists to facilitate running Keycloak Admin Client in native mode, you just need to initialize
Keycloak
the way you'd usually do according to the docs/examples in the Keycloak repository (I'm not sure I can see some obvious references though), here is how it is done in Quarkus test:So the injection does not work. However, now that you've typed this code, I wonder if we can enhance this extension a bit and support this…