2026-03-30 18:52:03 +02:00
|
|
|
security:
|
|
|
|
|
# https://symfony.com/doc/current/security.html#registering-the-user-hashing-passwords
|
|
|
|
|
password_hashers:
|
|
|
|
|
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'auto'
|
|
|
|
|
|
|
|
|
|
# https://symfony.com/doc/current/security.html#loading-the-user-the-user-provider
|
|
|
|
|
providers:
|
2026-04-01 15:42:52 +02:00
|
|
|
app_user_provider:
|
|
|
|
|
entity:
|
|
|
|
|
class: App\Entity\User
|
|
|
|
|
property: email
|
2026-03-30 18:52:03 +02:00
|
|
|
|
|
|
|
|
firewalls:
|
|
|
|
|
dev:
|
|
|
|
|
pattern: ^/(_profiler|_wdt|assets|build)/
|
|
|
|
|
security: false
|
2026-04-01 15:42:52 +02:00
|
|
|
webhooks:
|
|
|
|
|
pattern: ^/webhooks/
|
|
|
|
|
security: false
|
2026-03-30 18:52:03 +02:00
|
|
|
main:
|
|
|
|
|
lazy: true
|
2026-04-01 15:42:52 +02:00
|
|
|
provider: app_user_provider
|
|
|
|
|
entry_point: form_login
|
|
|
|
|
custom_authenticators:
|
|
|
|
|
- App\Security\KeycloakAuthenticator
|
|
|
|
|
form_login:
|
|
|
|
|
login_path: app_home
|
|
|
|
|
check_path: app_home
|
|
|
|
|
username_parameter: _username
|
|
|
|
|
password_parameter: _password
|
|
|
|
|
success_handler: App\Security\LoginSuccessHandler
|
|
|
|
|
logout:
|
|
|
|
|
path: app_logout
|
|
|
|
|
two_factor:
|
|
|
|
|
auth_form_path: 2fa_login
|
|
|
|
|
check_path: 2fa_login_check
|
|
|
|
|
default_target_path: app_home
|
|
|
|
|
prepare_on_login: true
|
|
|
|
|
prepare_on_access_denied: true
|
|
|
|
|
enable_csrf: true
|
2026-03-30 18:52:03 +02:00
|
|
|
|
2026-04-01 15:42:52 +02:00
|
|
|
role_hierarchy:
|
|
|
|
|
ROLE_CUSTOMER: ROLE_USER
|
|
|
|
|
ROLE_REVENDEUR: ROLE_CUSTOMER
|
|
|
|
|
ROLE_MEMBER: ROLE_USER
|
|
|
|
|
ROLE_EMPLOYE: ROLE_MEMBER
|
|
|
|
|
ROLE_ROOT: [ROLE_EMPLOYE, ROLE_REVENDEUR]
|
2026-03-30 18:52:03 +02:00
|
|
|
|
|
|
|
|
# Note: Only the *first* matching rule is applied
|
|
|
|
|
access_control:
|
2026-04-01 15:42:52 +02:00
|
|
|
- { path: ^/2fa, role: IS_AUTHENTICATED_2FA_IN_PROGRESS }
|
|
|
|
|
- { path: ^/admin, roles: ROLE_EMPLOYE }
|
|
|
|
|
- { path: ^/espace-client, roles: ROLE_CUSTOMER }
|
|
|
|
|
- { path: ^/espace-prestataire, roles: ROLE_REVENDEUR }
|
2026-03-30 18:52:03 +02:00
|
|
|
|
|
|
|
|
when@test:
|
|
|
|
|
security:
|
|
|
|
|
password_hashers:
|
|
|
|
|
# Password hashers are resource-intensive by design to ensure security.
|
|
|
|
|
# In tests, it's safe to reduce their cost to improve performance.
|
|
|
|
|
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface:
|
|
|
|
|
algorithm: auto
|
|
|
|
|
cost: 4 # Lowest possible value for bcrypt
|
|
|
|
|
time_cost: 3 # Lowest possible value for argon
|
|
|
|
|
memory_cost: 10 # Lowest possible value for argon
|