2025-12-09 17:11:08 +01:00
|
|
|
security:
|
|
|
|
|
providers:
|
2025-12-11 17:22:26 +01:00
|
|
|
app_account_provider:
|
|
|
|
|
entity:
|
|
|
|
|
class: App\Entity\Account
|
2026-01-15 18:51:17 +01:00
|
|
|
property: email
|
2025-12-09 17:11:08 +01:00
|
|
|
|
|
|
|
|
firewalls:
|
|
|
|
|
dev:
|
2025-12-11 17:22:26 +01:00
|
|
|
pattern: ^/(_(profiler|wdt)|css|images|js)/
|
2025-12-09 17:11:08 +01:00
|
|
|
security: false
|
2025-12-11 17:22:26 +01:00
|
|
|
|
2025-12-09 17:11:08 +01:00
|
|
|
main:
|
|
|
|
|
lazy: true
|
2026-01-15 18:51:17 +01:00
|
|
|
provider: app_account_provider
|
2025-12-11 17:22:26 +01:00
|
|
|
user_checker: App\Security\UserChecker
|
2026-01-15 18:51:17 +01:00
|
|
|
|
|
|
|
|
# --- AJOUT DE LA CONFIGURATION 2FA ---
|
|
|
|
|
two_factor:
|
|
|
|
|
auth_form_path: 2fa_login # Route d'affichage du formulaire
|
|
|
|
|
check_path: 2fa_login_check # Route de soumission du code
|
2026-01-16 10:04:02 +01:00
|
|
|
default_target_path: /
|
2026-01-15 18:51:17 +01:00
|
|
|
# -------------------------------------
|
|
|
|
|
|
2025-12-11 17:22:26 +01:00
|
|
|
form_login:
|
2026-01-15 18:51:17 +01:00
|
|
|
login_path: app_home
|
|
|
|
|
check_path: app_home
|
|
|
|
|
enable_csrf: true
|
|
|
|
|
csrf_token_id: authenticate
|
|
|
|
|
|
2025-12-11 17:22:26 +01:00
|
|
|
entry_point: App\Security\AuthenticationEntryPoint
|
2026-01-15 18:51:17 +01:00
|
|
|
|
2025-12-11 17:22:26 +01:00
|
|
|
custom_authenticator:
|
|
|
|
|
- App\Security\LoginFormAuthenticator
|
2026-01-15 18:04:01 +01:00
|
|
|
- App\Security\KeycloakAuthenticator
|
2026-01-15 18:51:17 +01:00
|
|
|
|
2025-12-11 17:22:26 +01:00
|
|
|
logout:
|
2026-01-15 18:51:17 +01:00
|
|
|
path: app_logout # Assurez-vous d'utiliser 'path'
|
|
|
|
|
target: app_home
|
2025-12-09 17:11:08 +01:00
|
|
|
|
2025-12-11 17:22:26 +01:00
|
|
|
password_hashers:
|
2026-01-15 18:51:17 +01:00
|
|
|
App\Entity\Account: 'auto'
|
2025-12-09 17:11:08 +01:00
|
|
|
|
2025-12-11 17:22:26 +01:00
|
|
|
role_hierarchy:
|
2026-01-15 22:07:01 +01:00
|
|
|
ROLE_ROOT: [ROLE_ADMIN,ROLE_CLIENT_MAIN]
|
|
|
|
|
ROLE_CLIENT_MAIN: [ROLE_ADMIN]
|
|
|
|
|
|
2025-12-09 17:11:08 +01:00
|
|
|
|
|
|
|
|
access_control:
|
2026-01-15 18:51:17 +01:00
|
|
|
# Permettre l'accès aux pages 2FA même si on n'est pas encore pleinement "ROLE_ADMIN"
|
|
|
|
|
- { path: ^/2fa, roles: PUBLIC_ACCESS }
|
|
|
|
|
|
|
|
|
|
- { path: ^/crm, roles: [ROLE_ADMIN] }
|
|
|
|
|
- { path: ^/, roles: PUBLIC_ACCESS }
|