ERROR (EXTERNAL IP): Internal Server Error: / - django

We currently have a CA setup with django connected through its API (dogtag). We recently set up a new subordinate CA and tried to redirect django to this new IP, however we are receiving the following error when submitting a CSR request to my CA using django:
KeyError at /
'Output'
Request Method: POST
Request URL: https://10.10.50.4/
Django Version: 2.2.14
Python Executable: /app/PKIWeb/venv/bin/python3.6 Python Version: 3.6.6 Python Path: ['/app/PKIWeb', '/app/PKIWeb/venv/bin', '/app/PKIWeb/venv/lib64/python36.zip', '/app/PKIWeb/venv/lib64/python3.6', '/app/PKIWeb/venv/lib64/python3.6/lib-dynload', '/usr/lib64/python3.6', '/usr/lib/python3.6', '/app/PKIWeb/venv/lib/python3.6/site-packages']
Server time: Sáb, 26 Jun 2021 21:14:30 -0400 Installed Applications:
['django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'core',
'api',
'django_extensions',
'widget_tweaks',
'rest_framework',
'rest_framework_api_key',
'drf_yasg']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'camaracomercio.middleware.CsrAPILocaleMiddleware']
Traceback:
File "/app/PKIWeb/venv/lib/python3.6/site-packages/django/core/handlers/exception.py" in inner
34. response = get_response(request)
File "/app/PKIWeb/venv/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
115. response = self.process_exception_by_middleware(e, request)
File "/app/PKIWeb/venv/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
113. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/app/PKIWeb/venv/lib/python3.6/site-packages/django/views/generic/base.py" in view
71. return self.dispatch(request, *args, **kwargs)
File "/app/PKIWeb/venv/lib/python3.6/site-packages/django/views/generic/base.py" in dispatch
97. return handler(request, *args, **kwargs)
File "/app/PKIWeb/venv/lib/python3.6/site-packages/django/views/generic/edit.py" in post
142. return self.form_valid(form)
File "/app/PKIWeb/core/views.py" in form_valid
39. cert_request_infos = self.request_ca_certificate(data, profile)
File "/app/PKIWeb/core/views.py" in request_ca_certificate
62. enroll_request = client.create_enrollment_request(profile, data)
File "/app/PKIWeb/venv/lib/python3.6/site-packages/pki/__init__.py" in handler
304. return fn_call(inst, *args, **kwargs)
File "/app/PKIWeb/venv/lib/python3.6/site-packages/pki/cert.py" in create_enrollment_request
962. enrollment_template = self.get_enrollment_template(profile_id)
File "/app/PKIWeb/venv/lib/python3.6/site-packages/pki/__init__.py" in handler
304. return fn_call(inst, *args, **kwargs)
File "/app/PKIWeb/venv/lib/python3.6/site-packages/pki/cert.py" in get_enrollment_template
945. enrollment_template = CertEnrollmentRequest.from_json(r.json())
File "/app/PKIWeb/venv/lib/python3.6/site-packages/pki/cert.py" in from_json
520. outputs = attr_list['Output']
Exception Type: KeyError at /
Exception Value: 'Output'
This only happens with my new CA, this means I had an old CA setup and didn't face these issues.
Any inputs?

Related

Multiple Objects Returned Exception when entering wrong password in Django

I am using cookie cutter Django and on the url http://localhost:8000/accounts/login/ whenever I enter a wrong password I am getting the following traceback and a 500 Internal Server Error on the network console. I am using sqlite database. I am not able to understand why I am getting this error because when I create an empty project using the same database no such error is thrown.
Environment:
Request Method: POST
Request URL: http://localhost:8000/accounts/login/
Django Version: 2.1.4
Python Version: 3.6.7
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'crispy_forms',
'allauth',
'allauth.account',
'allauth.socialaccount',
'rest_framework',
'widget_tweaks',
'core.users.apps.UsersAppConfig',
'core.userManagement.apps.UsermanagementConfig',
'debug_toolbar',
'django_extensions']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'debug_toolbar.middleware.DebugToolbarMiddleware']
Traceback:
File "/home/power/Documents/Projects/core/venv/lib/python3.6/site-packages/django/core/handlers/exception.py" in inner
34. response = get_response(request)
File "/home/power/Documents/Projects/core/venv/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
126. response = self.process_exception_by_middleware(e, request)
File "/home/power/Documents/Projects/core/venv/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
124. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/power/Documents/Projects/core/venv/lib/python3.6/site-packages/django/views/generic/base.py" in view
68. return self.dispatch(request, *args, **kwargs)
File "/home/power/Documents/Projects/core/venv/lib/python3.6/site-packages/django/utils/decorators.py" in _wrapper
45. return bound_method(*args, **kwargs)
File "/home/power/Documents/Projects/core/venv/lib/python3.6/site-packages/django/views/decorators/debug.py" in sensitive_post_parameters_wrapper
76. return view(request, *args, **kwargs)
File "/home/power/Documents/Projects/core/venv/lib/python3.6/site-packages/allauth/account/views.py" in dispatch
137. return super(LoginView, self).dispatch(request, *args, **kwargs)
File "/home/power/Documents/Projects/core/venv/lib/python3.6/site-packages/allauth/account/views.py" in dispatch
80. **kwargs)
File "/home/power/Documents/Projects/core/venv/lib/python3.6/site-packages/django/views/generic/base.py" in dispatch
88. return handler(request, *args, **kwargs)
File "/home/power/Documents/Projects/core/venv/lib/python3.6/site-packages/allauth/account/views.py" in post
102. if form.is_valid():
File "/home/power/Documents/Projects/core/venv/lib/python3.6/site-packages/django/forms/forms.py" in is_valid
185. return self.is_bound and not self.errors
File "/home/power/Documents/Projects/core/venv/lib/python3.6/site-packages/django/forms/forms.py" in errors
180. self.full_clean()
File "/home/power/Documents/Projects/core/venv/lib/python3.6/site-packages/django/forms/forms.py" in full_clean
382. self._clean_form()
File "/home/power/Documents/Projects/core/venv/lib/python3.6/site-packages/django/forms/forms.py" in _clean_form
409. cleaned_data = self.clean()
File "/home/power/Documents/Projects/core/venv/lib/python3.6/site-packages/allauth/account/forms.py" in clean
179. **credentials)
File "/home/power/Documents/Projects/core/venv/lib/python3.6/site-packages/allauth/account/adapter.py" in authenticate
489. user = authenticate(request, **credentials)
File "/home/power/Documents/Projects/core/venv/lib/python3.6/site-packages/django/contrib/auth/__init__.py" in authenticate
73. user = backend.authenticate(request, **credentials)
File "/home/power/Documents/Projects/core/venv/lib/python3.6/site-packages/allauth/account/auth_backends.py" in authenticate
26. ret = self._authenticate_by_username(**credentials)
File "/home/power/Documents/Projects/core/venv/lib/python3.6/site-packages/allauth/account/auth_backends.py" in _authenticate_by_username
40. user = filter_users_by_username(username).get()
File "/home/power/Documents/Projects/core/venv/lib/python3.6/site-packages/django/db/models/query.py" in get
403. (self.model._meta.object_name, num)
Exception Type: MultipleObjectsReturned at /accounts/login/
Exception Value: get() returned more than one User -- it returned 2!

django-auth-ldap "an integer is required" error

Using Django 1.4 and django-auth-ldap 1.1, I'm trying to configure my web app to authenticate users against an LDAP service. On supplying the correct login credentials in the login form, I'm getting this error :-
TypeError at /login/
an integer is required
Request Method: POST
Request URL: http://mydomain.com:8000/login/
Django Version: 1.4
Exception Type: TypeError
Exception Value:
an integer is required
Exception Location: /usr/lib/python2.6/dist-packages/ldap/functions.py in _ldap_function_call, line 57
Python Executable: /usr/bin/python
Python Version: 2.6.5
....Python Path information
Why is this error happening ?
Here is the pasted trace info :-
Environment:
Request Method: POST
Request URL: http://localhost:8000/login/
Django Version: 1.4
Python Version: 2.6.5
Installed Applications:
('django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'django.contrib.admindocs',
'myapp')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware')
Traceback:
File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py" in get_response
111. response = callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/views/decorators/debug.py" in wrapper
69. return view(request, *args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/utils/decorators.py" in _wrapped_view
91. response = view_func(request, *args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/views/decorators/cache.py" in _wrapped_view_func
89. response = view_func(request, *args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/contrib/auth/views.py" in login
36. if form.is_valid():
File "/usr/local/lib/python2.6/dist-packages/django/forms/forms.py" in is_valid
124. return self.is_bound and not bool(self.errors)
File "/usr/local/lib/python2.6/dist-packages/django/forms/forms.py" in _get_errors
115. self.full_clean()
File "/usr/local/lib/python2.6/dist-packages/django/forms/forms.py" in full_clean
271. self._clean_form()
File "/usr/local/lib/python2.6/dist-packages/django/forms/forms.py" in _clean_form
299. self.cleaned_data = self.clean()
File "/usr/local/lib/python2.6/dist-packages/django/contrib/auth/forms.py" in clean
167. password=password)
File "/usr/local/lib/python2.6/dist-packages/django/contrib/auth/__init__.py" in authenticate
43. for backend in get_backends():
File "/usr/local/lib/python2.6/dist-packages/django/contrib/auth/__init__.py" in get_backends
34. backends.append(load_backend(backend_path))
File "/usr/local/lib/python2.6/dist-packages/django/contrib/auth/__init__.py" in load_backend
28. return cls()
File "/usr/local/lib/python2.6/dist-packages/django_auth_ldap-1.1.1-py2.6.egg/django_auth_ldap/backend.py" in __init__
93. self.ldap = self.ldap_module()
File "/usr/local/lib/python2.6/dist-packages/django_auth_ldap-1.1.1-py2.6.egg/django_auth_ldap/backend.py" in ldap_module
104. return _LDAPConfig.get_ldap(options)
File "/usr/local/lib/python2.6/dist-packages/django_auth_ldap-1.1.1-py2.6.egg/django_auth_ldap/config.py" in get_ldap
74. cls.ldap.set_option(opt, value)
File "/usr/lib/python2.6/dist-packages/ldap/functions.py" in set_option
124. _ldap_function_call(_ldap.set_option,option,invalue)
File "/usr/lib/python2.6/dist-packages/ldap/functions.py" in _ldap_function_call
57. result = func(*args,**kwargs)
Exception Type: TypeError at /login/
Exception Value: an integer is required
Your LDAP server is complaining about one of the key/value pairs in your AUTH_LDAP_GLOBAL_OPTIONS. Make sure you're using the ldap.OPT_* constants as the dictionary keys.

ValueError at /admin/ in Django

Thanks for looking into this. I'm very new to Django and LDAP Config....so any help is greatly appreciated!
ActivePython 2.6, Django-1.2.7, openldap-2.4.23, python-ldap
So i have the Django installed. I'm trying to configure LDAP to it by following this instruction http://djangosnippets.org/snippets/901/.
After making making changes as described in the above document, and when i run 'python manage.py runserver' I'm gettting this error. Any idea why this is happening? Been looking at this for about a week and no idea how to get this fixed.
Error:
ValueError at /admin/
option error
Request Method: POST
Request URL: http://0.0.0.0:8080/admin/
Django Version: 1.2.7
Exception Type: ValueError
Exception Value:
option error
Exception Location: /apps/essw/python/lib/python2.6/site-packages/python_ldap-2.4.10-py2.6-linux-x86_64.egg/ldap/functions.py in _ldap_function_call, line 63
Python Executable: /apps/essw/python/bin/python
Python Version: 2.6.7
Python Path: ['/apps/essw/mysite', '/apps/essw/python/lib/python2.6/site-packages/python_ldap-2.4.10-py2.6-linux-x86_64.egg', '/apps/essw/python/lib/python2.6/site-packages/elementtree-1.2.7_20070827_preview-py2.6.egg', '/apps/essw/python/lib/python2.6/site-packages/Markdown-2.2.0-py2.6.egg', '/apps/essw/python/lib/python2.6/site-packages/html5lib-0.95-py2.6.egg', '/apps/essw/python/lib/python26.zip', '/apps/essw/python/lib/python2.6', '/apps/essw/python/lib/python2.6/plat-linux2', '/apps/essw/python/lib/python2.6/lib-tk', '/apps/essw/python/lib/python2.6/lib-old', '/apps/essw/python/lib/python2.6/lib-dynload', '/apps/essw/python/lib/python2.6/site-packages', '/apps/essw/python/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg-info']
Server time: Wed, 25 Jul 2012 09:06:41 -0500
#ChrisPratt Thanks for the reply Chris! See if this is helpful
Environment:
Request Method: POST
Request URL: http://x.x.x.x:8080/admin/
Django Version: 1.2.7
Python Version: 2.6.7
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.admin',
'django.contrib.admindocs']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware')
Traceback:
File "/apps/essw/python/lib/python2.6/site-packages/django/core/handlers/base.py" in get_response
100. response = callback(request, *callback_args, **callback_kwargs)
File "/apps/essw/python/lib/python2.6/site-packages/django/contrib/admin/sites.py" in wrapper
208. return self.admin_view(view, cacheable)(*args, **kwargs)
File "/apps/essw/python/lib/python2.6/site-packages/django/utils/decorators.py" in _wrapped_view
76. response = view_func(request, *args, **kwargs)
File "/apps/essw/python/lib/python2.6/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
78. response = view_func(request, *args, **kwargs)
File "/apps/essw/python/lib/python2.6/site-packages/django/contrib/admin/sites.py" in inner
190. return self.login(request)
File "/apps/essw/python/lib/python2.6/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
78. response = view_func(request, *args, **kwargs)
File "/apps/essw/python/lib/python2.6/site-packages/django/contrib/admin/sites.py" in login
323. user = authenticate(username=username, password=password)
File "/apps/essw/python/lib/python2.6/site-packages/django/contrib/auth/__init__.py" in authenticate
52. user = backend.authenticate(**credentials)
File "/apps/essw/mysite/django_auth_ldap/backend.py" in authenticate
824. ldap.set_option(ldap.OPT_X_TLS_CACERTFILE,settings.AD_CERT_FILE)
File "/apps/essw/python/lib/python2.6/site-packages/python_ldap-2.4.10-py2.6-linux- x86_64.egg/ldap/functions.py" in set_option
132. return _ldap_function_call(None,_ldap.set_option,option,invalue)
File "/apps/essw/python/lib/python2.6/site-packages/python_ldap-2.4.10-py2.6-linux- x86_64.egg/ldap/functions.py" in _ldap_function_call
63. result = func(*args,**kwargs)
Exception Type: ValueError at /admin/
Exception Value: option error

Created a child page and got a 500

As the title states, I created a 'child' page and BAM: 500. Following is what I believe is the actual traceback, and a bit of information on the 500 page that I believe is germane to the topic.
Is there anything I can do? I attempted to manually remove the page afterwards to no prevail. (Don't worry, I modified a copy of the database).
AssertionError at /admin/cms/page/
Negative indexing is not supported.
Request Method: GET
Request URL: http://192.168.56.101:8080/admin/cms/page/
Django Version: 1.3.1
Exception Type: AssertionError
Exception Value:
Negative indexing is not supported.
Exception Location: /usr/local/lib/python2.7/dist-packages/django/db/models/query.py in __getitem__, line 157
Python Executable: /usr/bin/python
Python Version: 2.7.3
Environment:
Request Method: GET
Request URL: http://192.168.56.101:8080/admin/cms/page/
Django Version: 1.3.1
Python Version: 2.7.3
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.admin',
'django.contrib.staticfiles',
'cms',
'menus',
'mptt',
'south',
'cms.plugins.text',
'cms.plugins.picture',
'cms.plugins.link',
'cms.plugins.file',
'cms.plugins.snippet',
'cms.plugins.googlemap',
'sekizai',
'registration',
'cms_themes']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'cms.middleware.page.CurrentPageMiddleware',
'cms.middleware.user.CurrentUserMiddleware',
'cms.middleware.toolbar.ToolbarMiddleware')
Traceback:
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
111. response = callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/contrib/admin/options.py" in wrapper
307. return self.admin_site.admin_view(view)(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/utils/decorators.py" in _wrapped_view
93. response = view_func(request, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/views/decorators/cache.py" in _wrapped_view_func
79. response = view_func(request, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/contrib/admin/sites.py" in inner
197. return view(request, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/cms/admin/pageadmin.py" in changelist_view
657. cl.set_items(request)
File "/usr/local/lib/python2.7/dist-packages/cms/admin/change_list.py" in set_items
198. children[-1].last = False
File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py" in __getitem__
157. "Negative indexing is not supported."
Exception Type: AssertionError at /admin/cms/page/
Exception Value: Negative indexing is not supported.
Make sure your version of django-mptt is 0.5.1.

Django Python Social Auth, Authentication Canceled by Facebook app

I am trying to implement website login using Facebook credentials. I see different responses when I press Cancel on Facebook widget or Okay. When I press Cancel I see the following
Environment:
Request Method: GET
Request URL: http://wakevent.com/complete/facebook/?redirect_state=cvZGNl42bKvgcDDDezBy14VJ1Eit5OmT&error=access_denied&error_code=200&error_description=Permissions+error&error_reason=user_denied&state=cvZGNl42bKvgcDDDezBy14VJ1Eit5OmT
Django Version: 1.8.2
Python Version: 2.7.6
Installed Applications:
('django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'mainapp',
'social.apps.django_app.default')
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.middleware.security.SecurityMiddleware',
'social.apps.django_app.middleware.SocialAuthExceptionMiddleware')
Traceback:
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
132. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/views/decorators/cache.py" in _wrapped_view_func
57. response = view_func(request, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/views/decorators/csrf.py" in wrapped_view
58. return view_func(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/social/apps/django_app/utils.py" in wrapper
51. return func(request, backend, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/social/apps/django_app/views.py" in complete
28. redirect_name=REDIRECT_FIELD_NAME, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/social/actions.py" in do_complete
43. user = backend.complete(user=user, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/social/backends/base.py" in complete
41. return self.auth_complete(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/social/utils.py" in wrapper
229. return func(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/social/backends/facebook.py" in auth_complete
68. self.process_error(self.data)
File "/usr/local/lib/python2.7/dist-packages/social/backends/facebook.py" in process_error
60. super(FacebookOAuth2, self).process_error(data)
File "/usr/local/lib/python2.7/dist-packages/social/backends/oauth.py" in process_error
363. raise AuthCanceled(self, data.get('error_description', ''))
Exception Type: AuthCanceled at /complete/facebook/
Exception Value: Authentication process canceled
Which is predicatble. But when I press Okay I see another error.
Environment:
Request Method: GET
Request URL: http://wakevent.com/complete/facebook/?redirect_state=cvZGNl42bKvgcDDDezBy14VJ1Eit5OmT&code=AQBe5WWQYk9BJE2fvNIt0RWVYxLaddhXT6t3UQwtF3aJcvbbLrVwsMlxsKEgwulVAtV4WHlYG5lG1HbEHk_cjFhMfWEHy9B8dedrOZagw0AWyGVyvaFtRqOn8_3G8nQb2nEe-DZMdG13V7Jgzrebtu6QXxGuyNzZPVXRnbPiKGUz8jW2p-r_wWB7QAuW-6rdZuII8_1ePBBoGgzmLlKLvMLfZoCqI62h0slF5t2IoAraHahRtnkWeIeH6AVf5u4vzZ8qXatz9fuun8ZK-8rqv5p5HDWZOdydNGm7ZtNh0g1OSpZU4TFAGxAqWbo0LpgiCRs&state=cvZGNl42bKvgcDDDezBy14VJ1Eit5OmT
Django Version: 1.8.2
Python Version: 2.7.6
Installed Applications:
('django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'mainapp',
'social.apps.django_app.default')
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.middleware.security.SecurityMiddleware',
'social.apps.django_app.middleware.SocialAuthExceptionMiddleware')
Traceback:
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
132. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/views/decorators/cache.py" in _wrapped_view_func
57. response = view_func(request, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/views/decorators/csrf.py" in wrapped_view
58. return view_func(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/social/apps/django_app/utils.py" in wrapper
51. return func(request, backend, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/social/apps/django_app/views.py" in complete
28. redirect_name=REDIRECT_FIELD_NAME, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/social/actions.py" in do_complete
43. user = backend.complete(user=user, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/social/backends/base.py" in complete
41. return self.auth_complete(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/social/utils.py" in wrapper
232. raise AuthCanceled(args[0])
Exception Type: AuthCanceled at /complete/facebook/
Exception Value: Authentication process canceled
I am running the website locally on Ubuntu 14.04 apache web server with 80 port. I suspect wrong Facebook app setup but do not know what to debug.
Also, I can mention that Twitter login is working on the same setup.
Please advise!
I did wrong Facebook app setup. In the Security / Server IP Whitelist I put 127.0.0.1 address. The problem was gone after removing this address (blank space is okey).
Check the redirect URL. I had wrongly specified redirect URL along with client ID while making post request. For Facebook redirect URI is optional. Try removing that and it will work fine.