kilork.github.io

keycloak

A Rust client for the Keycloak Admin REST API, regenerated for every release.

Keycloak publishes its admin API as one big OpenAPI document, and it moves with every Keycloak release. A hand-written client is behind the day it is written. So this one is generated, in lockstep: the crate version matches the Keycloak release it speaks to.

What changes for you

Getting it

cargo add keycloak

Then acquire an admin token and call the API:

let token = KeycloakAdminToken::acquire(&url, &user, &password, &client).await?;
let admin = KeycloakAdmin::new(&url, token, client);
let clients = admin.realm_clients_get("master", None, Some(0), Some(10), None, None, None).await?;

Turning features off keeps a build lean:

[dependencies]
keycloak = { version = "26.8.100", default-features = false, features = ["reqwest", "tag-users", "tag-clients"] }

Where to look

source · crate · docs