From 3648132aa4c820481bb08ed70f9cdc298d0406bc Mon Sep 17 00:00:00 2001 From: Steven Bal Date: Tue, 9 Jan 2024 11:42:20 +0100 Subject: [PATCH] :recycle: [#76] Make groups_claim optional to make it possible to disable group assignment --- ..._alter_openidconnectconfig_groups_claim.py | 23 +++++++++++++++++++ mozilla_django_oidc_db/models.py | 1 + 2 files changed, 24 insertions(+) create mode 100644 mozilla_django_oidc_db/migrations/0014_alter_openidconnectconfig_groups_claim.py diff --git a/mozilla_django_oidc_db/migrations/0014_alter_openidconnectconfig_groups_claim.py b/mozilla_django_oidc_db/migrations/0014_alter_openidconnectconfig_groups_claim.py new file mode 100644 index 0000000..8240ed0 --- /dev/null +++ b/mozilla_django_oidc_db/migrations/0014_alter_openidconnectconfig_groups_claim.py @@ -0,0 +1,23 @@ +# Generated by Django 3.2.23 on 2024-01-09 10:38 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("mozilla_django_oidc_db", "0013_merge_20231221_1529"), + ] + + operations = [ + migrations.AlterField( + model_name="openidconnectconfig", + name="groups_claim", + field=models.CharField( + blank=True, + default="roles", + help_text="The name of the OIDC claim that holds the values to map to local user groups.", + max_length=50, + verbose_name="groups claim", + ), + ), + ] diff --git a/mozilla_django_oidc_db/models.py b/mozilla_django_oidc_db/models.py index 4e2041f..c404e83 100644 --- a/mozilla_django_oidc_db/models.py +++ b/mozilla_django_oidc_db/models.py @@ -257,6 +257,7 @@ class OpenIDConnectConfig(CachingMixin, OpenIDConnectConfigBase): help_text=_( "The name of the OIDC claim that holds the values to map to local user groups." ), + blank=True, ) sync_groups = models.BooleanField( _("Create local user groups if they do not exist yet"),