From 0c4efc6ef2da4016fe088a674d7e5e796d5776e7 Mon Sep 17 00:00:00 2001 From: John Nagro Date: Thu, 19 Jan 2023 16:22:10 -0500 Subject: [PATCH] fix: increase namespace for SSO username generation (#31619) --- common/djangoapps/third_party_auth/settings.py | 2 +- common/djangoapps/third_party_auth/tests/test_pipeline.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common/djangoapps/third_party_auth/settings.py b/common/djangoapps/third_party_auth/settings.py index 73332b7acc..e34d79fa84 100644 --- a/common/djangoapps/third_party_auth/settings.py +++ b/common/djangoapps/third_party_auth/settings.py @@ -100,7 +100,7 @@ def apply_settings(django_settings): django_settings.SOCIAL_AUTH_INACTIVE_USER_URL = '/auth/inactive' # Context processors required under Django. - django_settings.SOCIAL_AUTH_UUID_LENGTH = 4 + django_settings.SOCIAL_AUTH_UUID_LENGTH = 16 django_settings.DEFAULT_TEMPLATE_ENGINE['OPTIONS']['context_processors'] += ( 'social_django.context_processors.backends', 'social_django.context_processors.login_redirect', diff --git a/common/djangoapps/third_party_auth/tests/test_pipeline.py b/common/djangoapps/third_party_auth/tests/test_pipeline.py index 5922dfab99..e03e1df5f4 100644 --- a/common/djangoapps/third_party_auth/tests/test_pipeline.py +++ b/common/djangoapps/third_party_auth/tests/test_pipeline.py @@ -78,7 +78,7 @@ class PipelineOverridesTest(SamlIntegrationTestUtilities, IntegrationTestMixin, ('S.K.', 'S_K', False), ('S.K.', 'S_K_-9fe2', True), ('usernamewithcharacterlengthofmorethan30chars', 'usernamewithcharacterlengthofm', False), - ('usernamewithcharacterlengthofmorethan30chars', 'usernamewithcharacterlengt-9fe', True), + ('usernamewithcharacterlengthofmorethan30chars', 'usernamewithch-9fe2', True), ) @ddt.unpack @mock.patch('common.djangoapps.third_party_auth.pipeline.user_exists')