Skip to content

Django/Facebook login issue #56

@nicksnell

Description

@nicksnell

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)

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