From ec0bc10a7b18993ed381e80261fef0c8c80116ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20B=C3=B6hlke?= Date: Mon, 2 Mar 2026 09:30:22 +0000 Subject: [PATCH 1/2] feat: add keycloak_id field to user model for OIDC support --- collections/user.yml | 5 +++++ models.yml | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/collections/user.yml b/collections/user.yml index b1c372c7..8598e752 100644 --- a/collections/user.yml +++ b/collections/user.yml @@ -16,6 +16,11 @@ saml_id: minLength: 1 restriction_mode: B description: unique-key from IdP for SAML login +keycloak_id: + type: string + minLength: 1 + restriction_mode: B + description: unique-key from Keycloak for OIDC login (sub claim) pronoun: type: string maxLength: 32 diff --git a/models.yml b/models.yml index 23cbefd1..53473675 100644 --- a/models.yml +++ b/models.yml @@ -4407,6 +4407,11 @@ user: minLength: 1 restriction_mode: B description: unique-key from IdP for SAML login + keycloak_id: + type: string + minLength: 1 + restriction_mode: B + description: unique-key from Keycloak for OIDC login (sub claim) pronoun: type: string maxLength: 32 From 761c67d501bb98db25fdf4ff275f17614258841c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20B=C3=B6hlke?= Date: Mon, 2 Mar 2026 11:42:54 +0100 Subject: [PATCH 2/2] feat: add keycloak_id column to generated user_t schema Regenerated schema_relational.sql to include the keycloak_id field from models.yml in the user_t table definition. Co-Authored-By: Claude Opus 4.6 --- dev/sql/schema_relational.sql | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dev/sql/schema_relational.sql b/dev/sql/schema_relational.sql index 24093a5e..bad52b1f 100644 --- a/dev/sql/schema_relational.sql +++ b/dev/sql/schema_relational.sql @@ -1,7 +1,7 @@ -- schema_relational.sql for initial database setup OpenSlides -- Code generated. DO NOT EDIT. --- MODELS_YML_CHECKSUM = 'e0d5579236d105d49e687ac5999f0184' +-- MODELS_YML_CHECKSUM = '14017a938413f084ab18b4a3d4418765' -- Function and meta table definitions @@ -1392,6 +1392,7 @@ CREATE TABLE user_t ( username varchar(256) NOT NULL, member_number varchar(256), saml_id varchar(256) CONSTRAINT minlength_saml_id CHECK (char_length(saml_id) >= 1), + keycloak_id varchar(256) CONSTRAINT minlength_keycloak_id CHECK (char_length(keycloak_id) >= 1), pronoun varchar(32), title varchar(256), first_name varchar(256), @@ -1416,6 +1417,7 @@ CREATE TABLE user_t ( comment on column user_t.saml_id is 'unique-key from IdP for SAML login'; +comment on column user_t.keycloak_id is 'unique-key from Keycloak for OIDC login (sub claim)'; comment on column user_t.organization_management_level is 'Hierarchical permission level for the whole organization.';