From af646cccba3f10bec448e0d0d5dd3b0c9ecf6d32 Mon Sep 17 00:00:00 2001 From: Jim Martens Date: Tue, 28 Jan 2025 10:37:10 +0100 Subject: [PATCH] feat: Add Gitea client --- terraform/keycloak.tf | 18 ++++++++++++++++++ terraform/variables.tf | 6 ++++++ 2 files changed, 24 insertions(+) diff --git a/terraform/keycloak.tf b/terraform/keycloak.tf index f6f0af9..9a37533 100644 --- a/terraform/keycloak.tf +++ b/terraform/keycloak.tf @@ -55,3 +55,21 @@ resource "keycloak_oidc_identity_provider" "twomartens_github_identity_provider" # Logout and UI Settings ui_locales = true } + +resource "keycloak_openid_client" "twomartens_gitea" { + realm_id = keycloak_realm.twomartens_realm.id + name = "Gitea" + enabled = true + access_type = "CONFIDENTIAL" + client_id = "gitea" + client_secret = var.gitea_client_secret + standard_flow_enabled = true + use_refresh_tokens = false + + + consent_required = true + base_url = "https://git.2martens.de" + valid_redirect_uris = [ + "https://git.2martens.de/user/oauth2/keycloak/callback" + ] +} diff --git a/terraform/variables.tf b/terraform/variables.tf index 9930fc8..f722ba8 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -108,4 +108,10 @@ variable "github_identity_provider_client_secret" { description = "Client Secret of the GitHub identity provider" type = string sensitive = true +} + +variable "gitea_client_secret" { + description = "Client Secret of the Gitea OpenID client" + type = string + sensitive = true } \ No newline at end of file