security.yaml 1.9 KB

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