Django-allauth: It keeps redirecting to http

Created on 1 Apr 2018  路  3Comments  路  Source: pennersr/django-allauth

I made a Django app, install allauth and configured it.
SOCIALACCOUNT_PROVIDERS = { 'facebook': { 'METHOD': 'oauth2', 'SCOPE': ['email', 'public_profile'], 'AUTH_PARAMS': {'auth_type': 'reauthenticate'}, 'INIT_PARAMS': {'cookie': True}, 'FIELDS': [ 'id', 'email', 'name', 'first_name', 'last_name', 'verified', 'locale', 'timezone', 'link', 'gender', 'updated_time', ], 'EXCHANGE_TOKEN': True, 'VERIFIED_EMAIL': False, 'VERSION': 'v2.2', } }
INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.sites', 'social_django', 'allauth', 'allauth.account', 'allauth.socialaccount', 'allauth.socialaccount.providers.facebook', ]
index.html :
{% load socialaccount %} <a href="{% provider_login_url "facebook" method="oauth2" %}">Facebook OAuth2</a>
The problem with Fcaebook :
I want the redirect uri to start with HTTPS not HTTP (redirect_uri=http%3A%2)
because it giving me this error :
Insecure Login Blocked: You can't get an access token or log in to this app from an insecure page. Try re-loading the page as https://

Any suggestion pls?

Most helpful comment

Try ACCOUNT_DEFAULT_HTTP_PROTOCOL='https' in your settings. In any case, closing this -- this is a deployment issue, not an issue in allauth.

All 3 comments

Try ACCOUNT_DEFAULT_HTTP_PROTOCOL='https' in your settings. In any case, closing this -- this is a deployment issue, not an issue in allauth.

Try ACCOUNT_DEFAULT_HTTP_PROTOCOL='https' in your settings, this solution works.THanks

+1
ACCOUNT_DEFAULT_HTTP_PROTOCOL='https' solved this problem!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eillarra picture eillarra  路  3Comments

gitdeepak picture gitdeepak  路  5Comments

psychok7 picture psychok7  路  5Comments

aliabbas-2012 picture aliabbas-2012  路  6Comments

ConorMcGee picture ConorMcGee  路  5Comments