From 37b42bc57c8c0771c68ba2e2746f850cb664748e Mon Sep 17 00:00:00 2001 From: Jan Sandbrink Date: Thu, 5 Dec 2024 17:30:29 +0100 Subject: [PATCH] Allow to choose Keycloak as separate provider This change doesn't do a lot on its own. It merely makes it possible to create an OIDC provider of type "Keycloak", which you will also be able to see in the list of providers, but otherwise it feels and behaves like a regular custom provider. --- .../app/controllers/openid_connect/providers_controller.rb | 2 ++ modules/openid_connect/app/models/openid_connect/provider.rb | 2 +- modules/openid_connect/config/locales/en.yml | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/openid_connect/app/controllers/openid_connect/providers_controller.rb b/modules/openid_connect/app/controllers/openid_connect/providers_controller.rb index 7e9cd03ca290..396855798db1 100644 --- a/modules/openid_connect/app/controllers/openid_connect/providers_controller.rb +++ b/modules/openid_connect/app/controllers/openid_connect/providers_controller.rb @@ -22,6 +22,8 @@ def new "google" when "microsoft_entra" "microsoft_entra" + when "keycloak" + "keycloak" else "custom" end diff --git a/modules/openid_connect/app/models/openid_connect/provider.rb b/modules/openid_connect/app/models/openid_connect/provider.rb index c61e5b04589a..875e6c90e99f 100644 --- a/modules/openid_connect/app/models/openid_connect/provider.rb +++ b/modules/openid_connect/app/models/openid_connect/provider.rb @@ -2,7 +2,7 @@ module OpenIDConnect class Provider < AuthProvider include HashBuilder - OIDC_PROVIDERS = %w[google microsoft_entra custom].freeze + OIDC_PROVIDERS = %w[google microsoft_entra keycloak custom].freeze DISCOVERABLE_ATTRIBUTES_MANDATORY = %i[authorization_endpoint userinfo_endpoint token_endpoint diff --git a/modules/openid_connect/config/locales/en.yml b/modules/openid_connect/config/locales/en.yml index e1a8f4431cdd..9f42bee6c017 100644 --- a/modules/openid_connect/config/locales/en.yml +++ b/modules/openid_connect/config/locales/en.yml @@ -94,6 +94,8 @@ en: name: Google microsoft_entra: name: Microsoft Entra + keycloak: + name: Keycloak custom: name: Custom upsale: