From 3c019d84fd6c1669c6abd967c960ec0ca497e58d Mon Sep 17 00:00:00 2001 From: Alexander Korolev Date: Sat, 30 Mar 2024 15:58:19 +0100 Subject: [PATCH] try to activate admin-api feature --- .github/workflows/integration.yml | 4 ++-- examples/adduser.rs | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index e8ddf0b..bca2b90 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -22,6 +22,6 @@ jobs: run: cargo test - name: Run integration tests run: | - docker run -p 8080:8080 --name keycloak -e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=password quay.io/keycloak/keycloak:24.0.2 start-dev & - sleep 120 + docker run -p 8080:8080 --name keycloak -e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=password -e KC_FEATURES=admin-api quay.io/keycloak/keycloak:24.0.2 start-dev & + sleep 40 cargo run --example=adduser diff --git a/examples/adduser.rs b/examples/adduser.rs index 00bd9a2..64fea8f 100644 --- a/examples/adduser.rs +++ b/examples/adduser.rs @@ -8,6 +8,9 @@ async fn main() -> Result<(), Box> { let url = std::env::var("KEYCLOAK_ADDR").unwrap_or_else(|_| "http://localhost:8080/admin".into()); let user = std::env::var("KEYCLOAK_USER").unwrap_or_else(|_| "admin".into()); let password = std::env::var("KEYCLOAK_PASSWORD").unwrap_or_else(|_| "password".into()); + + eprintln!("Acquire token for {user}:{password}"); + let client = reqwest::Client::new(); let admin_token = KeycloakAdminToken::acquire(&url, &user, &password, &client).await?;