Skip to content

Authentication problem with Weibo backend when integrate with Django application #98

@josseph

Description

@josseph

Hi, I am trying to integrate python-social-auth into my application. I meet some problems when enable weibo backend.

The configurations like below.
1.

AUTHENTICATION_BACKENDS = (
    'social.backends.weibo.WeiboOAuth2',
    'django.contrib.auth.backends.ModelBackend',
) 
SOCIAL_AUTH_WEIBO_KEY = '*****'  // repalce the confidential key with star 
SOCIAL_AUTH_WEIBO_SECRET = '***' // remove the confidential secret with star
  1. use the Django example to run the social authentication.

After I enter my weibo account and click on login, the authentication failed at the step of http://test.com/complete/weibo/?state=A5aliysJJjDpLyPLdxjVZQirhPaPkAHs&code=9ea8dc11dba1b494415ad82d2b48e804

Some exceptions thrown:

HTTPError at /complete/weibo/
405 Client Error: Method Not Allowed

Stacktrace:

/Library/Python/2.7/site-packages/social/apps/django_app/utils.py in wrapper
            return func(request, backend, *args, **kwargs) ...
▶ Local vars
/Library/Python/2.7/site-packages/social/apps/django_app/views.py in complete
                       redirect_name=REDIRECT_FIELD_NAME, *args, **kwargs) ...
▶ Local vars
/Library/Python/2.7/site-packages/social/actions.py in do_complete
                                 *args, **kwargs) ...
▶ Local vars
/Library/Python/2.7/site-packages/social/strategies/base.py in complete
        return self.backend.auth_complete(*args, **kwargs) ...
▶ Local vars
/Library/Python/2.7/site-packages/social/backends/oauth.py in auth_complete
                method=self.ACCESS_TOKEN_METHOD ...
▶ Local vars
/Library/Python/2.7/site-packages/social/backends/oauth.py in request_access_token
        return self.get_json(*args, **kwargs) ...
▶ Local vars
/Library/Python/2.7/site-packages/social/backends/base.py in get_json
        return self.request(url, *args, **kwargs).json() ...
▶ Local vars
/Library/Python/2.7/site-packages/social/backends/base.py in request
        response.raise_for_status() ...
▶ Local vars
/Library/Python/2.7/site-packages/requests/models.py in raise_for_status

Could you help to trouble shooting this issue? Thanks.

Joseph

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions