Skip to content

Commit

Permalink
try to activate admin-api feature
Browse files Browse the repository at this point in the history
  • Loading branch information
kilork committed Mar 30, 2024
1 parent 25bc34d commit 3c019d8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions examples/adduser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
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?;

Expand Down

0 comments on commit 3c019d8

Please sign in to comment.