diff --git a/src/backend/core/authentication/backends.py b/src/backend/core/authentication/backends.py index 4df8074..8ea0a76 100644 --- a/src/backend/core/authentication/backends.py +++ b/src/backend/core/authentication/backends.py @@ -49,13 +49,14 @@ class OIDCAuthenticationBackend(LaSuiteOIDCAuthenticationBackend): ) return extra_claims - def post_get_or_create_user(self, user, claims): + def post_get_or_create_user(self, user, claims, is_new_user): """ Post-processing after user creation or retrieval. Args: user (User): The user instance. claims (dict): The claims dictionary. + is_new_user (bool): Indicates if the user was newly created. Returns: - None diff --git a/src/backend/core/tests/authentication/test_backends.py b/src/backend/core/tests/authentication/test_backends.py index 32b98de..a66a060 100644 --- a/src/backend/core/tests/authentication/test_backends.py +++ b/src/backend/core/tests/authentication/test_backends.py @@ -257,7 +257,7 @@ def test_models_oidc_user_getter_invalid_token(django_assert_num_queries, monkey django_assert_num_queries(0), pytest.raises( SuspiciousOperation, - match="User info contained no recognizable user identification", + match="Claims verification failed", ), ): klass.get_or_create_user(access_token="test-token", id_token=None, payload=None) diff --git a/src/backend/people/settings.py b/src/backend/people/settings.py index 4670a03..ad66d7b 100755 --- a/src/backend/people/settings.py +++ b/src/backend/people/settings.py @@ -392,6 +392,9 @@ class Base(Configuration): } # OIDC - Authorization Code Flow + OIDC_AUTHENTICATE_CLASS = "lasuite.oidc_login.views.OIDCAuthenticationRequestView" + OIDC_CALLBACK_CLASS = "lasuite.oidc_login.views.OIDCAuthenticationCallbackView" + OIDC_CREATE_USER = values.BooleanValue( default=True, environ_name="OIDC_CREATE_USER", diff --git a/src/backend/pyproject.toml b/src/backend/pyproject.toml index 7993f84..2e335b9 100644 --- a/src/backend/pyproject.toml +++ b/src/backend/pyproject.toml @@ -34,7 +34,7 @@ dependencies = [ "django-configurations==2.5.1", "django-cors-headers==4.7.0", "django-countries==7.6.1", - "django-lasuite==0.0.2", + "django-lasuite==0.0.5", "django-oauth-toolkit==3.0.1", "django-parler==2.3", "django-redis==5.4.0",