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

complete/mendeley-oauth2 not successful #501

Closed
cdeblois opened this issue Feb 2, 2015 · 2 comments
Closed

complete/mendeley-oauth2 not successful #501

cdeblois opened this issue Feb 2, 2015 · 2 comments

Comments

@cdeblois
Copy link
Contributor

cdeblois commented Feb 2, 2015

Using the django_example when I add my credentials to the settings file and attempt to runserver for django_example I'm getting the following after entering my credentials for Mendeley-OAuth2:

Internal Server Error: /complete/mendeley-oauth2/
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 112, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/lib/python2.7/dist-packages/django/views/decorators/cache.py", line 52, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/django/views/decorators/csrf.py", line 57, in wrapped_view
    return view_func(*args, **kwargs)
  File "../../social/apps/django_app/utils.py", line 52, in wrapper
    return func(request, backend, *args, **kwargs)
  File "../../social/apps/django_app/views.py", line 28, in complete
    redirect_name=REDIRECT_FIELD_NAME, *args, **kwargs)
  File "../../social/actions.py", line 40, in do_complete
    user = backend.complete(user=user, *args, **kwargs)
  File "../../social/backends/base.py", line 40, in complete
    return self.auth_complete(*args, **kwargs)
  File "../../social/backends/oauth.py", line 375, in auth_complete
    *args, **kwargs)
  File "../../social/backends/oauth.py", line 379, in do_auth
    data = self.user_data(access_token, *args, **kwargs)
  File "../../social/backends/mendeley.py", line 28, in user_data
    values = self.get_user_data(access_token)
  File "../../social/backends/mendeley.py", line 66, in get_user_data
    headers={'Authorization': 'Bearer {0}'.format(access_token)}
  File "../../social/backends/base.py", line 228, in get_json
    return self.request(url, *args, **kwargs).json()
  File "../../social/backends/base.py", line 224, in request
    response.raise_for_status()
  File "/usr/lib/python2.7/dist-packages/requests/models.py", line 773, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
HTTPError: 410 Client Error: Gone

Any help here would be greatly appreciated.

@cdeblois
Copy link
Contributor Author

cdeblois commented Feb 2, 2015

It seems that there is an old (OAPI) API request that is being used in the Mendeley-OAuth2 backend class. Also, it appears that the resulting response is no longer inside 'main'.

Old API (OAPI) request:

https://api-oauth2.mendeley.com/oapi/profiles/info/me/

Should now be:

https://api.mendeley.com/profiles/me/

Response (expecting 'main'):

local psa.mendeley.user_data values are:  
{
    u'discipline': {
        u'name': [value]
    },
    u'first_name': [value],
    u'last_name': [value],
    u'display_name': [value],
    u'disciplines': [
        {
            u'name': [value]
        }
    ],
    u'created': u'2013-11-14T22:48:56.000Z',
    u'photo': {
        u'square': u'http://s3.amazonaws.com/mendeley-photos/awaiting_square.png',
        u'standard': u'http://s3.amazonaws.com/mendeley-photos/awaiting.png'
    }, 
    u'user_type': u'normal',
    u'email': [value],
    u'photos': [
        {
            u'url': u'http://s3.amazonaws.com/mendeley-photos/awaiting.png',
            u'original': False,
            u'height': 120
        },
        {
            u'url': u'http://s3.amazonaws.com/mendeley-photos/awaiting_square.png',
            u'width': 48,
            u'original': False,
            u'height': 48
        }, 
        {
            u'url': u'http://s3.amazonaws.com/mendeley-photos/awaiting_square_256.png',
            u'width': 256,
            u'original': False,
            u'height': 256
        }
    ],
    u'link': [value],
    u'marketing': True,
    u'verified': True,
    u'id': u'39202a43-895c-3df9-9add-f2b1d63c5804',
    u'academic_status': u'Other Professional'
}

@cdeblois
Copy link
Contributor Author

cdeblois commented Feb 2, 2015

Should I submit a PULL request for this?

omab added a commit that referenced this issue Feb 10, 2015
@omab omab closed this as completed Apr 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants