forked from numerique-gouv/sites-faciles
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding user to a default group on creation
- Loading branch information
Chris Mann
committed
Nov 17, 2024
1 parent
6e1bc25
commit b068077
Showing
17 changed files
with
558 additions
and
481 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,53 @@ | ||
import os | ||
from dotenv import load_dotenv # Pour les variables d'.env | ||
|
||
from dotenv import load_dotenv # Pour les variables d'.env | ||
|
||
|
||
# Prendre les variables d'environnement | ||
load_dotenv() | ||
|
||
AUTHENTICATION_BACKENDS = ( | ||
# Needed to login by username in Django admin, regardless of `allauth` | ||
'django.contrib.auth.backends.ModelBackend', | ||
|
||
"django.contrib.auth.backends.ModelBackend", | ||
# `allauth` specific authentication methods, such as login by e-mail | ||
'allauth.account.auth_backends.AuthenticationBackend', | ||
"allauth.account.auth_backends.AuthenticationBackend", | ||
) | ||
|
||
SOCIALACCOUNT_PROVIDERS = { | ||
'openid_connect': { | ||
"OAUTH_PKCE_ENABLED": True, | ||
# 'SOCIALACCOUNT_ONLY': True, | ||
"APPS": [ | ||
{ | ||
"provider_id": "key-lesgrandsvoisins-com", | ||
"name": "key.lesgrandsvoisins.com", | ||
"client_id": os.getenv('OPENID_NAME'), | ||
"secret": os.getenv('OPENID_SECRET'), | ||
"settings": { | ||
"server_url": os.getenv('OPENID_URL'), | ||
# Optional token endpoint authentication method. | ||
# May be one of "client_secret_basic", "client_secret_post" | ||
# If omitted, a method from the the server's | ||
# token auth methods list is used | ||
"token_auth_method": "client_secret_post", | ||
}, | ||
}, | ||
], | ||
} | ||
"openid_connect": { | ||
"OAUTH_PKCE_ENABLED": True, | ||
# 'SOCIALACCOUNT_ONLY': True, | ||
"APPS": [ | ||
{ | ||
"provider_id": "key-lesgrandsvoisins-com", | ||
"name": "key.lesgrandsvoisins.com", | ||
"client_id": os.getenv("OPENID_NAME"), | ||
"secret": os.getenv("OPENID_SECRET"), | ||
"settings": { | ||
"server_url": os.getenv("OPENID_URL"), | ||
# Optional token endpoint authentication method. | ||
# May be one of "client_secret_basic", "client_secret_post" | ||
# If omitted, a method from the the server's | ||
# token auth methods list is used | ||
"token_auth_method": "client_secret_post", | ||
}, | ||
}, | ||
], | ||
} | ||
} | ||
|
||
# LOGIN_URL = '/login/' | ||
# LOGIN_REDIRECT_URL = '/' | ||
ACCOUNT_AUTHENTICATION_METHOD = "username" | ||
SOCIALACCOUNT_AUTO_SIGNUP = True | ||
ACCOUNT_EMAIL_VERIFICATION = 'none' | ||
ACCOUNT_EMAIL_VERIFICATION = "none" | ||
SOCIALACCOUNT_ONLY = True | ||
ACCOUNT_DEFAULT_HTTP_PROTOCOL = 'https' | ||
ACCOUNT_DEFAULT_HTTP_PROTOCOL = "https" | ||
# # ACCOUNT_LOGIN_ON_EMAIL_CONFIRMATION = True | ||
# ACCOUNT_LOGOUT_ON_GET = True | ||
# # ACCOUNT_LOGOUT_REDIRECT_URL = '/login/' | ||
# ACCOUNT_PRESERVE_USERNAME_CASING = False | ||
# ACCOUNT_SESSION_REMEMBER = True | ||
# # ACCOUNT_SIGNUP_PASSWORD_ENTER_TWICE = False | ||
# ACCOUNT_USERNAME_BLACKLIST = ["admin", "god"] | ||
# # ACCOUNT_USERNAME_MIN_LENGTH = 2 | ||
# # ACCOUNT_USERNAME_MIN_LENGTH = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ | |
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
|
Oops, something went wrong.