From 839aad8e5e08bdb845aa6b13c3409638b0ff45c5 Mon Sep 17 00:00:00 2001 From: Jan Szejko Date: Mon, 9 Apr 2018 19:00:42 +0200 Subject: [PATCH] add google to social account providers --- src/wolnelektury/settings/__init__.py | 1 + src/wolnelektury/settings/auth.py | 33 +++++++++++++++++++++++---- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/src/wolnelektury/settings/__init__.py b/src/wolnelektury/settings/__init__.py index 72035d972..ca70e9f6d 100644 --- a/src/wolnelektury/settings/__init__.py +++ b/src/wolnelektury/settings/__init__.py @@ -99,6 +99,7 @@ INSTALLED_APPS_CONTRIB = [ 'allauth.socialaccount', 'allauth.socialaccount.providers.openid', 'allauth.socialaccount.providers.facebook', + 'allauth.socialaccount.providers.google', # 'allauth.socialaccount.providers.twitter', ] diff --git a/src/wolnelektury/settings/auth.py b/src/wolnelektury/settings/auth.py index 79da587e0..e07581e55 100644 --- a/src/wolnelektury/settings/auth.py +++ b/src/wolnelektury/settings/auth.py @@ -17,9 +17,34 @@ SOCIALACCOUNT_QUERY_EMAIL = True SOCIALACCOUNT_PROVIDERS = { 'openid': { - 'SERVERS': [{ - 'id': 'google', - 'name': 'Google', - 'openid_url': 'https://www.google.com/accounts/o8/id'}], + 'SERVERS': [], + }, + 'google': { + 'AUTH_PARAMS': { + 'access_type': 'online', + } + }, + '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, + # 'LOCALE_FUNC': 'path.to.callable', + # 'VERIFIED_EMAIL': False, + # 'VERSION': 'v2.12', }, } -- 2.20.1