2019-12-26 11:20:49 +01:00
|
|
|
security:
|
2019-12-26 15:17:48 +01:00
|
|
|
encoders:
|
|
|
|
App\Entity\User:
|
|
|
|
algorithm: auto
|
|
|
|
|
2019-12-26 11:20:49 +01:00
|
|
|
# https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
|
|
|
|
providers:
|
2019-12-26 15:17:48 +01:00
|
|
|
# used to reload user from session & other features (e.g. switch_user)
|
|
|
|
app_user_provider:
|
|
|
|
entity:
|
|
|
|
class: App\Entity\User
|
|
|
|
property: email
|
2019-12-26 11:20:49 +01:00
|
|
|
firewalls:
|
|
|
|
dev:
|
|
|
|
pattern: ^/(_(profiler|wdt)|css|images|js)/
|
|
|
|
security: false
|
|
|
|
main:
|
2019-12-26 15:17:48 +01:00
|
|
|
anonymous: ~
|
|
|
|
guard:
|
|
|
|
authenticators:
|
|
|
|
- App\Security\LoginFormAuthentificatorAuthenticator
|
|
|
|
logout:
|
|
|
|
path: app_logout
|
|
|
|
# where to redirect after logout
|
|
|
|
# target: app_any_route
|
2019-12-26 11:20:49 +01:00
|
|
|
|
|
|
|
# activate different ways to authenticate
|
|
|
|
# https://symfony.com/doc/current/security.html#firewalls-authentication
|
|
|
|
|
|
|
|
# https://symfony.com/doc/current/security/impersonating_user.html
|
|
|
|
# switch_user: true
|
|
|
|
|
|
|
|
# Easy way to control access for large sections of your site
|
|
|
|
# Note: Only the *first* access control that matches will be used
|
|
|
|
access_control:
|
2019-12-26 15:17:48 +01:00
|
|
|
- { path: ^/login$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
|
2019-12-26 11:20:49 +01:00
|
|
|
# - { path: ^/admin, roles: ROLE_ADMIN }
|
|
|
|
# - { path: ^/profile, roles: ROLE_USER }
|