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:
- # https://symfony.com/doc/current/security.html#b-configuring-how-users-are-loaded
- providers:
- in_memory:
- memory:
- users:
- ryan:
- password: $2y$12$rcpFPGFhlAJmjggrSFK3yeIzzJrgytAk3dQs0haTLJqA0VYYWINGS
- roles: 'ROLE_USER'
- admin:
- password: $2y$12$POimZopEuyiG30cIDv58C.FDVljvaYz3hBwEo8CdOGpTpjS6Q7dbC
- roles: 'ROLE_ADMIN'
- encoders:
- Symfony\Component\Security\Core\User\User:
- algorithm: bcrypt
- cost: 12
- firewalls:
- # disables authentication for assets and the profiler, adapt it according to your needs
- dev:
- pattern: ^/(_(profiler|wdt)|css|images|js)/
- security: false
- main:
- anonymous: ~
- # activate different ways to authenticate
- logout_on_user_change: true
- form_login:
- login_path: login
- check_path: login
- success_handler: app.login_handler
- logout:
- path: /logout
- target: /
- access_control:
- # require ROLE_ADMIN for /admin*
- - { path: ^/admin, roles: ROLE_ADMIN }
- - { path: ^/user, roles: ROLE_USER }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement