Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # To get started with security, check out the documentation:
- # https://symfony.com/doc/current/security.html
- security:
- encoders:
- AdminBundle\Entity\AdminUser: bcrypt
- role_hierarchy:
- ROLE_ADMIN: [ROLE_USER]
- # https://symfony.com/doc/current/security.html#b-configuring-how-users-are-loaded
- providers:
- admin:
- entity: { class: AdminBundle\Entity\AdminUser , property: email }
- firewalls:
- # disables authentication for assets and the profiler, adapt it according to your needs
- dev:
- pattern: ^/(_(profiler|wdt)|css|images|js)/
- security: false
- admin:
- pattern: ^/admin
- anonymous: ~
- guard:
- authenticators:
- - app.security.admin_login_form_authenticator
- logout:
- path: /admin/logout
- remember_me:
- secret: '%secret%'
- lifetime: 604800 # 1 week in seconds
- path: /
- always_remember_me: true
- main:
- anonymous: ~
- # activate different ways to authenticate
- # https://symfony.com/doc/current/security.html#a-configuring-how-your-users-will-authenticate
- #http_basic: ~
- # https://symfony.com/doc/current/security/form_login_setup.html
- #form_login: ~
- access_control:
- - { path: ^/admin/login$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- - { path: ^/admin, roles: ROLE_ADMIN }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement