My guess is because FB can't redirect to a localhost URL. You could probably use something like no-ip.org and setup a reachable URL.
HTH, Tim On Tue, Dec 24, 2013 at 5:05 AM, Nobin Mathew <[email protected]>wrote: > Hi, > > I am writing a django website using django-allauth for facebook > authentication. > > When I sign into facebook(after giving username and passwd) from my local > development server( > `<`http://127.0.0.1:8001/gallery/`<http://127.0.0.1:8001/gallery/>>` > ) I get following error: > > *************** > Social Network Login Failure > > An error occurred while attempting to login via your social network > account. > *************** > > and url in browser while on this error is > http://localhost:8001/gallery/accounts/facebook/login/callback/. > > > Settings: > > Facebook.com app setting: > AppId =XXX(not shown) > APP secret =xxx(not shown) > > Wbsite:Site URL = > http://localhost:8001/gallery/accounts/facebook/login/callback/ > > Django setting(local): > > LOGIN_REDIRECT_URL = ' > http://localhost:8001/gallery/accounts/facebook/login/callback/' > > SOCIALACCOUNT_PROVIDERS = { > 'facebook': { > 'SCOPE': ['email', 'publish_stream'], > 'AUTH_PARAMS': { 'auth_type': 'reauthenticate' }, > 'METHOD': 'oauth2' # instead of 'oauth2' > } > } > > ACCOUNT_LOGOUT_REDIRECT_URL = '/gallery' > SOCIALACCOUNT_QUERY_EMAIL = True > SOCIALACCOUNT_AUTO_SIGNUP = True > ACCOUNT_EMAIL_VERIFICATION = False > > > > and my base.html template is (not full): > <body> > {% load url from future %} > {% load socialaccount %} > {% if request.user.is_authenticated %} > <a href="{% url 'account_logout' %}">Logout</a> > {% else %} > <a href="{% url 'account_signup' %}">Sign Up</a> > <a href="{% url 'account_login' %}">Log in</a> > <a href="{% provider_login_url 'facebook' > method='oauth2' %}"> > Sign Up/Login with Facebook</a> > {% endif %} > </body> > > > > > When I am error page > http://localhost:8001/gallery/accounts/facebook/login/callback/ it says I > am logged in (i.e. displays Logout and user is authenticated). > > Any Idea why this happens? Any help will be appreciated. > > > > > > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/aba71009-2066-48aa-8502-0e90699295e3%40googlegroups.com > . > For more options, visit https://groups.google.com/groups/opt_out. > -- MLHIM VIP Signup: http://goo.gl/22B0U ============================================ Timothy Cook, MSc +55 21 94711995 MLHIM http://www.mlhim.org Like Us on FB: https://www.facebook.com/mlhim2 Circle us on G+: http://goo.gl/44EV5 Google Scholar: http://goo.gl/MMZ1o LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2B%3DOU3V9n23Wep17u%2B6V3Fe-sKii-Nf1juu-30jU4yAM_eXo6A%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.

