From 3b9fa60488d36b8f094d5c22ecdbe96f4b43144a Mon Sep 17 00:00:00 2001 From: Thomas Darimont Date: Wed, 12 Jul 2023 23:30:01 +0200 Subject: [PATCH] Realm setting internationalizationEnabled required to manage user locale We need to configure internationalizationEnabled to be able to supply a locale attribute during user creation The enforcement was introduced in Keycloak 22.0.0, see: https://github.com/keycloak/keycloak/commit/d0691b088403149bf78bc671ba1611978ab5ccdb but the realm property exists for many years already and is thus safe to set. --- .../roles/71.1_import_realm_with_nested_composites.json | 1 + .../roles/71.2_import_realm_with_nested_composites.json | 1 + .../roles/71.3_import_realm_with_nested_composites.json | 1 + .../resources/import-files/users/00_create_realm_with_user.json | 1 + .../import-files/users/01_update_realm_add_clientuser.json | 1 + .../users/02.1_update_realm_change_clientusers_password.json | 1 + .../users/02.2_update_realm_change_clientusers_password.json | 1 + ...0.1_create_realm_with_email_as_username_without_username.json | 1 + ...0.2_update_realm_with_email_as_username_without_username.json | 1 + ...pdate_realm_with_email_as_username_with_invalid_username.json | 1 + ...pdate_realm_with_email_as_username_with_correct_username.json | 1 + 11 files changed, 11 insertions(+) diff --git a/src/test/resources/import-files/roles/71.1_import_realm_with_nested_composites.json b/src/test/resources/import-files/roles/71.1_import_realm_with_nested_composites.json index 7fcb148e3..8d7365bad 100644 --- a/src/test/resources/import-files/roles/71.1_import_realm_with_nested_composites.json +++ b/src/test/resources/import-files/roles/71.1_import_realm_with_nested_composites.json @@ -1,6 +1,7 @@ { "enabled": true, "realm": "realmWithRoles71", + "internationalizationEnabled": true, "roles": { "realm": [ { diff --git a/src/test/resources/import-files/roles/71.2_import_realm_with_nested_composites.json b/src/test/resources/import-files/roles/71.2_import_realm_with_nested_composites.json index b09a4389e..0ac57ac21 100644 --- a/src/test/resources/import-files/roles/71.2_import_realm_with_nested_composites.json +++ b/src/test/resources/import-files/roles/71.2_import_realm_with_nested_composites.json @@ -1,6 +1,7 @@ { "enabled": true, "realm": "realmWithRoles71", + "internationalizationEnabled": true, "roles": { "realm": [ { diff --git a/src/test/resources/import-files/roles/71.3_import_realm_with_nested_composites.json b/src/test/resources/import-files/roles/71.3_import_realm_with_nested_composites.json index 4b5bcaa01..05e0a8632 100644 --- a/src/test/resources/import-files/roles/71.3_import_realm_with_nested_composites.json +++ b/src/test/resources/import-files/roles/71.3_import_realm_with_nested_composites.json @@ -1,6 +1,7 @@ { "enabled": true, "realm": "realmWithRoles71", + "internationalizationEnabled": true, "roles": { "realm": [ { diff --git a/src/test/resources/import-files/users/00_create_realm_with_user.json b/src/test/resources/import-files/users/00_create_realm_with_user.json index 6d40537b7..6a3562e2e 100644 --- a/src/test/resources/import-files/users/00_create_realm_with_user.json +++ b/src/test/resources/import-files/users/00_create_realm_with_user.json @@ -1,6 +1,7 @@ { "enabled": true, "realm": "realmWithUsers", + "internationalizationEnabled": true, "users": [ { "username": "myuser", diff --git a/src/test/resources/import-files/users/01_update_realm_add_clientuser.json b/src/test/resources/import-files/users/01_update_realm_add_clientuser.json index c79b269f1..28a2125de 100644 --- a/src/test/resources/import-files/users/01_update_realm_add_clientuser.json +++ b/src/test/resources/import-files/users/01_update_realm_add_clientuser.json @@ -1,6 +1,7 @@ { "enabled": true, "realm": "realmWithUsers", + "internationalizationEnabled": true, "users": [ { "username": "myuser", diff --git a/src/test/resources/import-files/users/02.1_update_realm_change_clientusers_password.json b/src/test/resources/import-files/users/02.1_update_realm_change_clientusers_password.json index 073f35cbe..9c99b74db 100644 --- a/src/test/resources/import-files/users/02.1_update_realm_change_clientusers_password.json +++ b/src/test/resources/import-files/users/02.1_update_realm_change_clientusers_password.json @@ -1,6 +1,7 @@ { "enabled": true, "realm": "realmWithUsers", + "internationalizationEnabled": true, "users": [ { "username": "myuser", diff --git a/src/test/resources/import-files/users/02.2_update_realm_change_clientusers_password.json b/src/test/resources/import-files/users/02.2_update_realm_change_clientusers_password.json index 6e3123d2e..008318e42 100644 --- a/src/test/resources/import-files/users/02.2_update_realm_change_clientusers_password.json +++ b/src/test/resources/import-files/users/02.2_update_realm_change_clientusers_password.json @@ -1,6 +1,7 @@ { "enabled": true, "realm": "realmWithUsers", + "internationalizationEnabled": true, "users": [ { "username": "myuser", diff --git a/src/test/resources/import-files/users/50.1_create_realm_with_email_as_username_without_username.json b/src/test/resources/import-files/users/50.1_create_realm_with_email_as_username_without_username.json index c8bfc42f7..177d003e5 100644 --- a/src/test/resources/import-files/users/50.1_create_realm_with_email_as_username_without_username.json +++ b/src/test/resources/import-files/users/50.1_create_realm_with_email_as_username_without_username.json @@ -1,6 +1,7 @@ { "enabled": true, "realm": "realmWithUsers", + "internationalizationEnabled": true, "registrationAllowed": true, "registrationEmailAsUsername": true, "users": [ diff --git a/src/test/resources/import-files/users/50.2_update_realm_with_email_as_username_without_username.json b/src/test/resources/import-files/users/50.2_update_realm_with_email_as_username_without_username.json index adb73e8fd..058df39a7 100644 --- a/src/test/resources/import-files/users/50.2_update_realm_with_email_as_username_without_username.json +++ b/src/test/resources/import-files/users/50.2_update_realm_with_email_as_username_without_username.json @@ -1,6 +1,7 @@ { "enabled": true, "realm": "realmWithUsers", + "internationalizationEnabled": true, "registrationAllowed": true, "registrationEmailAsUsername": true, "users": [ diff --git a/src/test/resources/import-files/users/50.3_update_realm_with_email_as_username_with_invalid_username.json b/src/test/resources/import-files/users/50.3_update_realm_with_email_as_username_with_invalid_username.json index 295162e58..ccd14e472 100644 --- a/src/test/resources/import-files/users/50.3_update_realm_with_email_as_username_with_invalid_username.json +++ b/src/test/resources/import-files/users/50.3_update_realm_with_email_as_username_with_invalid_username.json @@ -1,6 +1,7 @@ { "enabled": true, "realm": "realmWithUsers", + "internationalizationEnabled": true, "registrationAllowed": true, "registrationEmailAsUsername": true, "users": [ diff --git a/src/test/resources/import-files/users/50.4_update_realm_with_email_as_username_with_correct_username.json b/src/test/resources/import-files/users/50.4_update_realm_with_email_as_username_with_correct_username.json index 213bd6d8f..a7c2bc42c 100644 --- a/src/test/resources/import-files/users/50.4_update_realm_with_email_as_username_with_correct_username.json +++ b/src/test/resources/import-files/users/50.4_update_realm_with_email_as_username_with_correct_username.json @@ -1,6 +1,7 @@ { "enabled": true, "realm": "realmWithUsers", + "internationalizationEnabled": true, "registrationAllowed": true, "registrationEmailAsUsername": true, "users": [