SSO fails on addresses records with no associated account

Bug #812742 reported by Selene ToyKeeper
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Canonical SSO provider
Won't Fix
Medium
Unassigned

Bug Description

In the rare cases where an email address exists in SSO without an associated account, SSO fails instead of handling the situation. This may be worth fixing in the code, or it may be only necessary to fix the database and prevent the situation from happening again.

Example failures are in 1988canistellaunchpad9 and 2025carambolalaunchpad9. The former, IIRC, was what happens when trying to log in with the non-account address, and the latter is what happens when trying to add the stray address to a real account. In either case, the traceback is similar:

Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/django/core/handlers/base.py", line 92, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib/pymodules/python2.6/django/contrib/csrf/middleware.py", line 135, in wrapped_view
    resp = view_func(*args, **kwargs)
  File "/usr/lib/pymodules/python2.6/django/contrib/csrf/middleware.py", line 148, in wrapped_view
    return view_func(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/identityprovider/decorators.py", line 25, in _guest_required_decorator
    return func(request, *args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/identityprovider/decorators.py", line 31, in _dont_cache_decorator
    response = func(request, *args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/identityprovider/decorators.py", line 87, in wrapper
    return self.view_wrapper(request, fn, *args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/identityprovider/decorators.py", line 103, in view_wrapper
    return fn(request, *args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/identityprovider/decorators.py", line 63, in wrapper
    return func(request, *args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/identityprovider/views/ui.py", line 56, in login
    if form.is_valid():
  File "/usr/lib/pymodules/python2.6/django/forms/forms.py", line 120, in is_valid
    return self.is_bound and not bool(self.errors)
  File "/usr/lib/pymodules/python2.6/django/forms/forms.py", line 111, in _get_errors
    self.full_clean()
  File "/usr/lib/pymodules/python2.6/django/forms/forms.py", line 250, in full_clean
    self.cleaned_data = self.clean()
  File "/usr/lib/python2.6/dist-packages/identityprovider/forms.py", line 60, in clean
    user = auth.authenticate(username=email, password=password)
  File "/usr/lib/pymodules/python2.6/django/contrib/auth/__init__.py", line 37, in authenticate
    user = backend.authenticate(**credentials)
  File "/usr/lib/python2.6/dist-packages/identityprovider/auth.py", line 31, in authenticate
    if not account.is_active:
AttributeError: \'NoneType\' object has no attribute \'is_active\'

Changed in canonical-identity-provider:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Stuart Bishop (stub) wrote :

Dud rows have been removed and should not reappear.

Changed in canonical-identity-provider:
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.