upgrade allauth and facebook api
[wolnelektury.git] / src / wolnelektury / settings / auth.py
1 # -*- coding: utf-8 -*-
2 # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
3 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
4 #
5 AUTHENTICATION_BACKENDS = [
6     'django.contrib.auth.backends.ModelBackend',
7     # 'allauth.account.auth_backends.AuthenticationBackend',
8 ]
9 ACCOUNT_EMAIL_CONFIRMATION_EXPIRE_DAYS = 2
10 LOGIN_URL = '/uzytkownik/login/'
11
12 LOGIN_REDIRECT_URL = '/'
13
14 SOCIALACCOUNT_AUTO_SIGNUP = False
15 SOCIALACCOUNT_QUERY_EMAIL = True
16
17
18 SOCIALACCOUNT_PROVIDERS = {
19     'openid': {
20         'SERVERS': [],
21     },
22     'google': {
23         'AUTH_PARAMS': {
24             'access_type': 'online',
25         }
26     },
27     'facebook': {
28         'METHOD': 'oauth2',
29         'SCOPE': ['email', 'public_profile'],
30         # 'AUTH_PARAMS': {'auth_type': 'reauthenticate'},
31         # 'INIT_PARAMS': {'cookie': True},
32         # 'FIELDS': [
33         #     'id',
34         #     'email',
35         #     'name',
36         #     'first_name',
37         #     'last_name',
38         #     'verified',
39         #     'locale',
40         #     'timezone',
41         #     'link',
42         #     'gender',
43         #     'updated_time',
44         # ],
45         # 'EXCHANGE_TOKEN': True,
46         # 'LOCALE_FUNC': 'path.to.callable',
47         # 'VERIFIED_EMAIL': False,
48         'VERSION': 'v2.12',
49     },
50 }