From: Jan Szejko Date: Mon, 9 Apr 2018 17:00:42 +0000 (+0200) Subject: add google to social account providers X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/839aad8e5e08bdb845aa6b13c3409638b0ff45c5?hp=04ed822e3985e1565a1d652017be4004b4ddf8f3 add google to social account providers --- 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', }, }