security.yaml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. security:
  2. # https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
  3. providers:
  4. users:
  5. entity:
  6. class: 'App\Entity\LocalUser'
  7. property: 'nickname'
  8. firewalls:
  9. dev:
  10. pattern: ^/(_(profiler|wdt)|css|images|js)/
  11. security: false
  12. main:
  13. anonymous: true
  14. lazy: true
  15. provider: users
  16. guard:
  17. authenticators:
  18. - App\Security\Authenticator
  19. logout:
  20. path: logout
  21. # where to redirect after logout
  22. target: main_all
  23. remember_me:
  24. secret: '%kernel.secret%'
  25. secure: true
  26. httponly: '%remember_me_httponly%'
  27. samesite: '%remember_me_samesite%'
  28. token_provider: 'Symfony\Bridge\Doctrine\Security\RememberMe\DoctrineTokenProvider'
  29. # activate different ways to authenticate
  30. # https://symfony.com/doc/current/security.html#firewalls-authentication
  31. # https://symfony.com/doc/current/security/impersonating_user.html
  32. # switch_user: true
  33. # Easy way to control access for large sections of your site
  34. # Note: Only the *first* access control that matches will be used
  35. access_control:
  36. - { path: ^/admin, roles: ROLE_ADMIN }
  37. - { path: ^/settings, roles: ROLE_USER }