Django-allauth: Social Network Login Failure

Created on 15 Nov 2014  路  6Comments  路  Source: pennersr/django-allauth

Internal Server Error: /accounts/facebook/login/callback/

My version is new every things fine looks fine

Social Network Login Failure
An error occurred while attempting to login via your social network account.

MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',

'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.middleware.transaction.TransactionMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
 #'nocache.NoCache',
# Uncomment the next line for simple clickjacking protection:
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
#'apps.utils.auth.LoginRequiredMiddleware',  # Login required globally, used in beta stage

)

TEMPLATE_CONTEXT_PROCESSORS = (
"django.core.context_processors.request",
"django.contrib.auth.context_processors.auth",
"django.core.context_processors.debug",
"django.core.context_processors.i18n",
"django.core.context_processors.media",
"django.core.context_processors.static",
"django.core.context_processors.tz",
"django.contrib.messages.context_processors.messages",
"apps.utils.context_processors.debug_mode",
"apps.utils.context_processors.is_production",

"allauth.account.context_processors.account",
"allauth.socialaccount.context_processors.socialaccount",

)

this for authentication wiht all auth

ACCOUNT_USER_MODEL_USERNAME_FIELD = None
ACCOUNT_AUTHENTICATION_METHOD = 'email'
ACCOUNT_EMAIL_REQUIRED = True
ACCOUNT_USERNAME_REQUIRED = False
ACCOUNT_SIGNUP_PASSWORD_VERIFICATION = False
SOCIALACCOUNT_QUERY_EMAIL = False
SOCIALACCOUNT_EMAIL_REQUIRED = True
ACCOUNT_EMAIL_VERIFICATION = 'optional'
SOCIALACCOUNT_AUTO_SIGNUP = True
ACCOUNT_SESSION_REMEMBER = True

well kindly guide me to solve this one

Most helpful comment

I am sorry, but I really do hope you understand that it is not doable for me to help out in each and every project. To make this project managable, I really have to close issues for which allauth is not the cause.

Having said that, do some debugging here:
https://github.com/pennersr/django-allauth/blob/master/allauth/socialaccount/providers/oauth2/views.py#L114

It will give you the cause of the error.

All 6 comments

This is something in your setup, check your keys or return URLs. Or, set a breakpoint at the location where the redirect to the failure page takes place. Other than that, I am time-wise unable to provide support on this matter ...

This is not fare

I am sorry, but I really do hope you understand that it is not doable for me to help out in each and every project. To make this project managable, I really have to close issues for which allauth is not the cause.

Having said that, do some debugging here:
https://github.com/pennersr/django-allauth/blob/master/allauth/socialaccount/providers/oauth2/views.py#L114

It will give you the cause of the error.

A great way to see the error is to override authentication_error.html:
http://stackoverflow.com/a/36728888/847165

at least auth errors {{ auth_error }} must be shown when in super debug mode, (localhost with debug ON)

callback url should be :-
/accounts/facebook/login/callback/
instead of :-
/accounts/facebook/login/callback

Was this page helpful?
0 / 5 - 0 ratings