From bca1768fc409cfcf03d545453cc04a5a9bf7fdb3 Mon Sep 17 00:00:00 2001 From: Pierre Hubert Date: Fri, 2 Jun 2023 09:48:51 +0200 Subject: [PATCH] Add test OIDC provider --- README.md | 20 +++++++++++++++++++- geneit_backend/docker-compose.yaml | 8 ++++++++ geneit_backend/src/app_config.rs | 10 +++++++--- 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8ff7e36..59d21c4 100644 --- a/README.md +++ b/README.md @@ -34,4 +34,22 @@ diesel migation run > > ```bash > PGPASSWORD=pass psql -h localhost -p 5432 -U user -d geneit -> ``` \ No newline at end of file +> ``` + +## Test OIDC credentials +Emails: + +``` +harley@qlik.example +barb@qlik.example +quinn@qlik.example +sim@qlik.example +phillie@qlik.example +peta@qlik.example +peta@qlik.example +sibylla@qlik.example +evan@qlik.example +franklin@qlik.example +``` + +Password: `Password1!` \ No newline at end of file diff --git a/geneit_backend/docker-compose.yaml b/geneit_backend/docker-compose.yaml index 2570db0..b183ac6 100644 --- a/geneit_backend/docker-compose.yaml +++ b/geneit_backend/docker-compose.yaml @@ -40,4 +40,12 @@ services: volumes: - ./storage/redis-data:/data - ./storage/redis-conf:/usr/local/etc/redis/redis.conf + + oidc: + image: qlik/simple-oidc-provider + environment: + - REDIRECTS=http://localhost:3000/oidc_cb + - PORT=9001 + ports: + - 9001:9001 \ No newline at end of file diff --git a/geneit_backend/src/app_config.rs b/geneit_backend/src/app_config.rs index 1b09e5d..b8d2748 100644 --- a/geneit_backend/src/app_config.rs +++ b/geneit_backend/src/app_config.rs @@ -89,7 +89,11 @@ pub struct AppConfig { pub reset_password_url: String, /// URL where the OpenID configuration can be found - #[arg(long, env, default_value = "url")] + #[arg( + long, + env, + default_value = "http://localhost:9001/.well-known/openid-configuration" + )] pub oidc_configuration_url: String, /// Disable OpenID authentication @@ -101,11 +105,11 @@ pub struct AppConfig { pub oidc_provider_name: String, /// OpenID client ID - #[arg(long, env, default_value = "client")] + #[arg(long, env, default_value = "foo")] pub oidc_client_id: String, /// OpenID client secret - #[arg(long, env, default_value = "secret")] + #[arg(long, env, default_value = "bar")] pub oidc_client_secret: String, /// OpenID login callback URL