Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New user oauth issue #126

Open
djow2019 opened this issue Jul 3, 2018 · 7 comments
Open

New user oauth issue #126

djow2019 opened this issue Jul 3, 2018 · 7 comments

Comments

@djow2019
Copy link
Collaborator

djow2019 commented Jul 3, 2018

When a new user tries to get access:

Internal Server Error: /wd_oauth
Traceback (most recent call last):
File "/home/ubuntu/.virtualenvs/nginx-django/lib/python3.5/site-packages/django/core/handlers/exception.py", line 41, in inner
response = get_response(request)
File "/home/ubuntu/.virtualenvs/nginx-django/lib/python3.5/site-packages/django/core/handlers/base.py", line 249, in _legacy_get_response
response = self._get_response(request)
File "/home/ubuntu/.virtualenvs/nginx-django/lib/python3.5/site-packages/django/core/handlers/base.py", line 187, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/home/ubuntu/.virtualenvs/nginx-django/lib/python3.5/site-packages/django/core/handlers/base.py", line 185, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/ubuntu/.virtualenvs/nginx-django/lib/python3.5/site-packages/django/utils/decorators.py", line 149, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "./wiki/views.py", line 351, in wd_oauth
authentication.continue_oauth(oauth_callback_data=body['url'].encode("utf-8"))
File "/home/ubuntu/.virtualenvs/nginx-django/lib/python3.5/site-packages/wikidataintegrator/wdi_login.py", line 206, in continue_oauth
self.generate_edit_credentials()
File "/home/ubuntu/.virtualenvs/nginx-django/lib/python3.5/site-packages/wikidataintegrator/wdi_login.py", line 146, in generate_edit_credentials
self.edit_token = response.json()['query']['tokens']['csrftoken']
KeyError: 'query'

@djow2019
Copy link
Collaborator Author

djow2019 commented Jul 3, 2018

image.png

@djow2019
Copy link
Collaborator Author

djow2019 commented Jul 3, 2018

Related:

mwoauth.errors.OAuthException: Unexpect request token key b'6dc70e884056b0428c692cb24fc06c13', expected b'4d5a74c4faf5a76772d9f74a3d68d981'.

@djow2019
Copy link
Collaborator Author

djow2019 commented Jul 3, 2018

Found the issue! It is either an issue with wdi login or mediawiki.

When you create an account for the first time from CHLAMBASE (clicking authorize to edit -> join media wiki), it DOES NOT auto sign in to WIKIDATA. This is the bug: you should be autosigned in to wikidata after you sign in from media wiki. Thus, it gives the illusion you are signed into mediawiki even though you are not signed into wikidata!

Solutions:

  1. From media wiki, sign out then sign in
  2. OR From wikidata, sign in

When you create an account for the first time from MEDIAWIKI (selecting create account from homepage), it DOES auto sign in to WIKIDTA. This is correct functionality, and will allow you to immediately get authorization access from chlambase

Workaround:

  1. Create account from mediawiki OR wikidata directly (so you are already signed in correctly)

@djow2019
Copy link
Collaborator Author

djow2019 commented Jul 5, 2018

@djow2019
Copy link
Collaborator Author

djow2019 commented Jul 6, 2018

The bug was filed on phabricator.wikimedia.org: https://phabricator.wikimedia.org/T198940

@khybiske
Copy link
Collaborator

@djow2019 @andrewsu One of my colleagues (Scott Hefty) wants to make some annotations, but he's getting errors when trying to authorize (log in) with his newly created wikidata account. Any known issues still? He showed me on Skype-screenshare, and he authorizes just like I normally do, but he ultimately gets an error pop up.

@djow2019
Copy link
Collaborator Author

On the dev site I created a FAQ at the bottom that addresses this potential issue for new users.
There is currently a bug where new accounts don't get logged into wikidata. But every subsequent login does. Tell him to navigate to wikidata.org and manually log in, or log out and back in. Then, try reauthorizing on chlambase again. In the future, it shouldn't happen.

  1. It looks like I'm authorized but I still am not. What do I do now?
    Clear your cache (optional). Then, navigate to WikiData and in the upper right corner, click "log in". Then go back to ChlamBase. If you are authorized, deauthorize. Then, reauthorize on ChlamBase and try to add your annotation again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants