0

I integrate django social-auth in my app.In settings i have given

AUTHENTICATION_BACKENDS,FACEBOOK_APP_ID,FACEBOOK_API_SECRET, social_auth.context_processors,SOCIAL_AUTH_PIPELINE etc.

when i click on facebook login it is redirecting to facebook app login when logged in it is redirected back to my app but redirecting to LOGIN_ERROR_URL and the user is not authenticated.

LOGIN_REDIRECT_URL = '/'

LOGOUT_URL= '/logout/'

LOGIN_ERROR_URL = '/login-error/'

SOCIAL_AUTH_LOGIN_REDIRECT_URL="/home/"

How can i solve this and get my app authenticated? Same is happening with google login also.Please help.

Thanks.

tom joy
  • 411
  • 8
  • 22
  • 1
    Are you defining any custom pipeline entry? If not, why do you define `SOCIAL_AUTH_PIPELINE`? Also, did you define an URL for that `/login-error/`? – omab Jun 26 '12 at 18:05

2 Answers2

0

This question is very similar to a recent one I just answered: django social auth error after completing pipeline . Over there, I said:

A good place to start would be to look in social-auth's views.py, at the few places where the redirect to LOGIN_ERROR_URL happens (the variable url is set to LOGIN_ERROR_URL and then HttpResponseRedirect(url) is called). Add some print statements, or better, set breakpoints using the python debugger. If you run your app in the Django development server, the print statements will show up in the terminal in which you ran the server. Otherwise, they may show up in your server logs, depending on your configuration. You may also find django-debug-toolbar helpful.

Using print statements or the debugger, my workflow would be:

  1. Figure out what line in views.py the redirect is triggered from
  2. Figure out what condition causes that line to be reached
  3. Inspect the variables leading to that condition

Sorry this is so general. Happy to help more if you can provide some more specific information.

Aaron

Community
  • 1
  • 1
foobarbecue
  • 6,780
  • 4
  • 28
  • 54
0

encountered same mysterious redirect to error url.

For me problem was with a typo in an argument of custom pipeline method.

Fixing the typo fixed the problem.

Denis Kanygin
  • 1,125
  • 12
  • 15