Advertisement
Guest User

security.yml

a guest
Jun 15th, 2017
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. # To get started with security, check out the documentation:
  2. # https://symfony.com/doc/current/security.html
  3. security:
  4.  
  5. encoders:
  6. AdminBundle\Entity\AdminUser: bcrypt
  7.  
  8. role_hierarchy:
  9. ROLE_ADMIN: [ROLE_USER]
  10.  
  11. # https://symfony.com/doc/current/security.html#b-configuring-how-users-are-loaded
  12. providers:
  13. admin:
  14. entity: { class: AdminBundle\Entity\AdminUser , property: email }
  15.  
  16. firewalls:
  17. # disables authentication for assets and the profiler, adapt it according to your needs
  18. dev:
  19. pattern: ^/(_(profiler|wdt)|css|images|js)/
  20. security: false
  21.  
  22. admin:
  23. pattern: ^/admin
  24. anonymous: ~
  25. guard:
  26. authenticators:
  27. - app.security.admin_login_form_authenticator
  28.  
  29. logout:
  30. path: /admin/logout
  31.  
  32. remember_me:
  33. secret: '%secret%'
  34. lifetime: 604800 # 1 week in seconds
  35. path: /
  36. always_remember_me: true
  37.  
  38. main:
  39. anonymous: ~
  40. # activate different ways to authenticate
  41.  
  42. # https://symfony.com/doc/current/security.html#a-configuring-how-your-users-will-authenticate
  43. #http_basic: ~
  44.  
  45. # https://symfony.com/doc/current/security/form_login_setup.html
  46. #form_login: ~
  47.  
  48.  
  49. access_control:
  50. - { path: ^/admin/login$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
  51. - { path: ^/admin, roles: ROLE_ADMIN }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement