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

Problem with weibo backend #85

Closed
ChateauXiao opened this issue Nov 12, 2013 · 1 comment
Closed

Problem with weibo backend #85

ChateauXiao opened this issue Nov 12, 2013 · 1 comment

Comments

@ChateauXiao
Copy link

Hi, I got the problem when using weibo backend in Django 1.4.5

I configured like this(Already created a web app in weibo developer site sae.sina.com.cn)

in settings.py

  WEIBO_CLIENT_KEY=""
  WEIBO_CLIENT_SECRET=""


AUTHENTICATION_BACKENDS = (
    'social.backends.weibo.WeiboOAuth2',
    'django.contrib.auth.backends.ModelBackend',
)

and edit a template home.html with this code:

{% load url from future %}
          <a href="{% url 'social:begin' "weibo" %}">Weibo Login</a> <br />

views.py

def loginTest(request):
    if request.user.is_authenticated():
        return redirect('done')
    return render_to_response('home.html', {
            'client_id': getattr(settings, 'WEIBO_CLIENT_KEY', None),
            'user': request.user,
            },
                              RequestContext(request))

it generate a url http://127.0.0.1:8000/login/weibo/

click it , will redirect to

https://api.weibo.com/oauth2/authorize?state=msHi0CsZbiAYjJGIo8ALBXYAEZ5NjWQ9&redirect_uri=http://127.0.0.1:8000/complete/weibo/&response_type=code&client_id=None

the problem is the Parameter client_id=None , it surpose to be client_id={WEIBO_CLIENT_KEY}, but it just failed to pass to the GET request here.

@omab
Copy link
Owner

omab commented Nov 12, 2013

Setting names should be SOCIAL_AUTH_WEIBO_KEY and SOCIAL_AUTH_WEIBO_SECRET.

@omab omab closed this as completed Nov 12, 2013
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