security.yaml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. # activate different ways to authenticate
  20. # https://symfony.com/doc/current/security.html#the-firewall
  21. # https://symfony.com/doc/current/security/impersonating_user.html
  22. # switch_user: true
  23. # Easy way to control access for large sections of your site
  24. # Note: Only the *first* access control that matches will be used
  25. access_control:
  26. # - { path: ^/admin, roles: ROLE_ADMIN }
  27. # - { path: ^/profile, roles: ROLE_USER }
  28. when@test:
  29. security:
  30. password_hashers:
  31. # By default, password hashers are resource intensive and take time. This is
  32. # important to generate secure password hashes. In tests however, secure hashes
  33. # are not important, waste resources and increase test times. The following
  34. # reduces the work factor to the lowest possible values.
  35. Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface:
  36. algorithm: auto
  37. cost: 4 # Lowest possible value for bcrypt
  38. time_cost: 3 # Lowest possible value for argon
  39. memory_cost: 10 # Lowest possible value for argon