security.yaml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. security:
  2. # https://symfony.com/doc/current/security.html#registering-the-user-hashing-passwords
  3. password_hashers:
  4. Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'auto'
  5. # https://symfony.com/doc/current/security.html#loading-the-user-the-user-provider
  6. providers:
  7. # used to reload user from session & other features (e.g. switch_user)
  8. app_user_provider:
  9. entity:
  10. class: App\Entity\User
  11. property: email
  12. firewalls:
  13. dev:
  14. pattern: ^/(_(profiler|wdt)|css|images|js)/
  15. security: false
  16. main:
  17. lazy: true
  18. provider: app_user_provider
  19. login_link:
  20. check_route: login_check
  21. signature_properties: ['id', email]
  22. # activate different ways to authenticate
  23. # https://symfony.com/doc/current/security.html#the-firewall
  24. # https://symfony.com/doc/current/security/impersonating_user.html
  25. # switch_user: true
  26. # Easy way to control access for large sections of your site
  27. # Note: Only the *first* access control that matches will be used
  28. access_control:
  29. # - { path: ^/admin, roles: ROLE_ADMIN }
  30. # - { path: ^/profile, roles: ROLE_USER }
  31. - { path: ^/login, roles: PUBLIC_ACCESS }
  32. - { path: ^/, roles: ROLE_USER }
  33. when@test:
  34. security:
  35. password_hashers:
  36. # By default, password hashers are resource intensive and take time. This is
  37. # important to generate secure password hashes. In tests however, secure hashes
  38. # are not important, waste resources and increase test times. The following
  39. # reduces the work factor to the lowest possible values.
  40. Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface:
  41. algorithm: auto
  42. cost: 4 # Lowest possible value for bcrypt
  43. time_cost: 3 # Lowest possible value for argon
  44. memory_cost: 10 # Lowest possible value for argon