Project

General

Profile

Bug #71411

crash au retour d'une authentification via OIDC quand plusieurs utilisateurs correspondent

Added by Thomas Noël 3 months ago. Updated 3 months ago.

Status:
Nouveau
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
17 November 2022
Due date:
% Done:

0%

Estimated time:
Patch proposed:
No
Planning:
No

Description

Cette trace dans les logs :

                                             Traceback (most recent call last):
                                               File "/usr/lib/python3/dist-packages/django/core/handlers/exception.py", line 34, in inner
                                                 response = get_response(request)
                                               File "/usr/lib/python3/dist-packages/django/core/handlers/base.py", line 115, in _get_response
                                                 response = self.process_exception_by_middleware(e, request)
                                               File "/usr/lib/python3/dist-packages/django/core/handlers/base.py", line 113, in _get_response
                                                 response = wrapped_callback(request, *callback_args, **callback_kwargs)
                                               File "/usr/lib/python3/dist-packages/django/views/generic/base.py", line 71, in view
                                                 return self.dispatch(request, *args, **kwargs)
                                               File "/usr/lib/python3/dist-packages/django/views/generic/base.py", line 97, in dispatch
                                                 return handler(request, *args, **kwargs)
                                               File "/usr/lib/python3/dist-packages/authentic2_auth_oidc/views.py", line 128, in get
                                                 response = self.handle_authorization_response(request)
                                               File "/usr/lib/python3/dist-packages/authentic2_auth_oidc/views.py", line 172, in handle_authorization_response
                                                 return self.handle_code(request, provider, nonce, code)
                                               File "/usr/lib/python3/dist-packages/authentic2_auth_oidc/views.py", line 285, in handle_code
                                                 user = authenticate(
                                               File "/usr/lib/python3/dist-packages/authentic2/utils/misc.py", line 1310, in authenticate
                                                 return dj_authenticate(request=request, **kwargs)
                                               File "/usr/lib/python3/dist-packages/django/contrib/auth/__init__.py", line 73, in authenticate
                                                 user = backend.authenticate(request, **credentials)
                                               File "/usr/lib/python3/dist-packages/authentic2_auth_oidc/backends.py", line 43, in authenticate
                                                 return self._authenticate(
                                               File "/usr/lib/python3/dist-packages/authentic2_auth_oidc/backends.py", line 273, in _authenticate
                                                 user = users.get_by_email(email)
                                               File "/usr/lib/python3/dist-packages/authentic2/custom_user/managers.py", line 174, in get_by_email
                                                 raise self.model.MultipleObjectsReturned
                                             authentic2.custom_user.models.User.MultipleObjectsReturned

Il faudrait certainement ne pas tomber sur une 500 mais afficher un problème d'utilisateurs multiples existants pour le mail recherché.

Also available in: Atom PDF