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

Django/Facebook login issue #56

Closed
nicksnell opened this issue Oct 10, 2013 · 1 comment
Closed

Django/Facebook login issue #56

nicksnell opened this issue Oct 10, 2013 · 1 comment

Comments

@nicksnell
Copy link

I seem to be having an issue with social auth and logging in via Facebook OAuth2 from Django.

When logging in the browser appears to get stuck in an infinite loop from the app to Facebook and back again, but only when the view Facebook is returning to takes longer than a certain time to complete (normally a longer than a few seconds).

It is repeatable using the example Django app, it requires a next parameter is added initially:

<a href="{% url 'social:begin' "facebook" %}?next=/done/">Facebook</a>

This in itself will work, however if the view is delayed from completing (a simple time.sleep will do) it will begin to loop. Test view looks like this:

@login_required
def done(request):
    """Login complete view, displays user data"""

    import time
    time.sleep(5)

    scope = ' '.join(GooglePlusAuth.DEFAULT_SCOPE)
    return render_to_response('done.html', {
        'user': request.user,
        'plus_id': getattr(settings, 'SOCIAL_AUTH_GOOGLE_PLUS_KEY', None),
        'plus_scope': scope
    }, RequestContext(request))

It does need to be a time >4 seconds it seems but it can vary. The console doesn't give much indication other than the requests are going through. However on odd occasions it will throw a "error: [Errno 32] Broken pipe" but continue looping. It's almost as if two requests are running simultaneously and competing with each other.

It's not overly clear why this is occurring, any thoughts where this might be going wrong?

(Running latest version of social auth and Django 1.5.4 - also tried 1.4.8 & 1.4.5 and it is consistent)

@nicksnell
Copy link
Author

Update: No longer seem to be experiencing this issue with Facebook with the same code that was failing for the last few days. Assuming it was a glitch somewhere Facebook's end. Would be interested to hear if there could be any other reason for this?

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

1 participant