editgroups icon indicating copy to clipboard operation
editgroups copied to clipboard

OAuth login error

Open wetneb opened this issue 6 years ago • 3 comments

When logging in via OAuth, the user can get a 500 error. We get this in the logs:

Internal Server Error: /editgroups/oauth/complete/mediawiki/
Traceback (most recent call last):
  File "/data/project/editgroups/www/python/venv/lib/python3.5/site-packages/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "/data/project/editgroups/www/python/venv/lib/python3.5/site-packages/django/core/handlers/base.py", line 126, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/data/project/editgroups/www/python/venv/lib/python3.5/site-packages/django/core/handlers/base.py", line 124, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/data/project/editgroups/www/python/venv/lib/python3.5/site-packages/django/views/decorators/cache.py", line 44, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "/data/project/editgroups/www/python/venv/lib/python3.5/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
    return view_func(*args, **kwargs)
  File "/data/project/editgroups/www/python/venv/lib/python3.5/site-packages/social_django/utils.py", line 49, in wrapper
    return func(request, backend, *args, **kwargs)
  File "/data/project/editgroups/www/python/venv/lib/python3.5/site-packages/social_django/views.py", line 33, in complete
    *args, **kwargs)
  File "/data/project/editgroups/www/python/venv/lib/python3.5/site-packages/social_core/actions.py", line 43, in do_complete
    user = backend.complete(user=user, *args, **kwargs)
  File "/data/project/editgroups/www/python/venv/lib/python3.5/site-packages/social_core/backends/base.py", line 40, in complete
    return self.auth_complete(*args, **kwargs)
  File "/data/project/editgroups/www/python/venv/lib/python3.5/site-packages/social_core/utils.py", line 251, in wrapper
    return func(*args, **kwargs)
  File "/data/project/editgroups/www/python/venv/lib/python3.5/site-packages/social_core/backends/oauth.py", line 182, in auth_complete
    token = self.get_unauthorized_token()
  File "/data/project/editgroups/www/python/venv/lib/python3.5/site-packages/social_core/backends/oauth.py", line 201, in get_unauthorized_token
    raise AuthTokenError(self, 'Missing unauthorized token')
social_core.exceptions.AuthTokenError: Token error: Missing unauthorized token

wetneb avatar Jun 11 '19 16:06 wetneb

Potentially related to: https://github.com/omab/django-social-auth/issues/634

wetneb avatar Jun 11 '19 16:06 wetneb

Apparently this is actually due to "Containers" which block cookies set from Wikidata to passing over to tools.wmflabs.org. We should display a more informative error message in that case.

wetneb avatar Jun 12 '19 12:06 wetneb

I think I've encountered the same issue on the Wikimedia Commons version of EditGroups, while trying to log in to undo this batch: https://editgroups-commons.toolforge.org/b/OR/c6f589e1442/

trnstlntk avatar Feb 22 '22 13:02 trnstlntk