I'm trying to resolve a connection error thrown by AllAuth/Django 1.7 running on Google App Engine: I believe the error may be in the Sessions configuration but I've not been able to identify the problem. Local signup is functioning correctly, but social logins throw an error.
edit: LinkedIn works fine.
edit: On the local server; I get "must be _socket.socket, not socket" after entering credentials.
edit: There seems to be some ambiguity with what AppEngine serving http or https; although the page is https, the URI is being received as http.
edit: My packages per pip freeze:
AppEngine-Email-Backend==1.0
Django==1.7.2
GoogleAppEngineCloudStorageClient==1.9.15.0
MySQL-python==1.2.4b4
bootstrap-admin==0.3.3
django-allauth==0.19.0
django-appengine-toolkit==0.2.1
django-crispy-forms==1.4.0
django-localflavor==1.1
djangoappengine==1.6.3
djangotoolbox==1.6.2
mysqlclient==1.3.4
oauthlib==0.7.2
python-openid==2.2.5
requests==2.5.1
requests-oauthlib==0.4.2
wsgiref==0.1.2
Here's my trace:
Request Method: GET
Request URL: https://[app].appspot.com/accounts/google/login/callback/?state=LrL6Pw08bT7r&code=4/Og6R5AWIQX9WFGyF7XsXAVJHfbyBLRbIqxnflCyS2Kg.omD5uljwob8dPm8kb2vw2M1dUc7elQI
Django Version: 1.7.2
Python Version: 2.7.5
Installed Applications:
('bootstrap_admin',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sites',
'django.contrib.admindocs',
'django.contrib.sitemaps',
'django.contrib.flatpages',
'appengine_toolkit',
'djangoappengine',
'localflavor',
'crispy_forms',
'allauth',
'allauth.account',
'allauth.socialaccount',
'allauth.socialaccount.providers.google',
'supplier',
'main')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware')
Traceback:
File "/base/data/home/apps/s~[app]/3.381542196672942284/django/core/handlers/base.py" in get_response
111. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/base/data/home/apps/s~[app]/3.381542196672942284/site_packages/allauth/socialaccount/providers/oauth2/views.py" in view
54. return self.dispatch(request, *args, **kwargs)
File "/base/data/home/apps/s~[app]/3.381542196672942284/site_packages/allauth/socialaccount/providers/oauth2/views.py" in dispatch
109. access_token = client.get_access_token(request.GET['code'])
File "/base/data/home/apps/s~[app]/3.381542196672942284/site_packages/allauth/socialaccount/providers/oauth2/client.py" in get_access_token
57. data=data)
File "/base/data/home/apps/s~[app]/3.381542196672942284/site_packages/requests/api.py" in request
49. response = session.request(method=method, url=url, **kwargs)
File "/base/data/home/apps/s~[app]/3.381542196672942284/site_packages/requests/sessions.py" in request
461. resp = self.send(prep, **send_kwargs)
File "/base/data/home/apps/s~[app]/3.381542196672942284/site_packages/requests/sessions.py" in send
573. r = adapter.send(request, **kwargs)
File "/base/data/home/apps/s~[app]/3.381542196672942284/site_packages/requests/adapters.py" in send
415. raise ConnectionError(err, request=request)
Exception Type: ConnectionError at /accounts/google/login/callback/
Exception Value: ('Connection aborted.', error(13, 'Permission denied'))
After doing some research, it seems AppEngine's problems were related to my installed version of requests.
I resolved this by
pip uninstall requests
(2.5.1), thenpip install requests==2.3
.Source