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?
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!
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.