11security :
2- encoders :
2+ # a new authentication system is available since Symfony 5.1 to make
3+ # Symfony security more extensible and easier to understand
4+ # https://symfony.com/doc/current/security/experimental_authenticators.html
5+ enable_authenticator_manager : true
6+
7+ password_hashers :
38 # Our user class and the algorithm we'll use to encode passwords
49 # 'auto' means to let Symfony choose the best possible password hasher (Argon2 or Bcrypt)
510 # https://symfony.com/doc/current/security.html#c-encoding-passwords
@@ -23,9 +28,6 @@ security:
2328 # this firewall applies to all URLs
2429 pattern : ^/
2530
26- # but the firewall does not require login on every page
27- # denying access is done in access_control or in your controllers
28- anonymous : true
2931 lazy : true
3032
3133 # The user provider to use.
@@ -40,8 +42,8 @@ security:
4042 # When the user tries to access a protected page, they are redirected here
4143 login_path : security_login
4244 # Secure the login form against CSRF
43- # Reference: https://symfony.com/doc/current/security/csrf.html#csrf-protection-in-login-forms
44- csrf_token_generator : security.csrf.token_manager
45+ # Reference: https://symfony.com/doc/current/security/csrf.html
46+ enable_csrf : true
4547 # The page users are redirect to when there is no previous page stored in the
4648 # session (for example when the users access directly to the login page).
4749 default_target_path : blog_index
@@ -52,6 +54,12 @@ security:
5254 # The name of the route to redirect to after logging out
5355 target : homepage
5456
57+ # needed because in tests we redefine the 'main' firewall to use
58+ # HTTP Basic instead of he login form, so this firewall has
59+ # multiple authenticators
60+ # See https://symfony.com/doc/current/security/experimental_authenticators.html#configuring-the-authentication-entry-point
61+ entry_point : ' form_login'
62+
5563 # Easy way to control access for large sections of your site
5664 # Note: Only the *first* access control that matches will be used
5765 access_control :
@@ -61,3 +69,11 @@ security:
6169
6270 role_hierarchy :
6371 ROLE_ADMIN : ROLE_USER
72+
73+ when@test :
74+ # this configuration simplifies testing URLs protected by the security mechanism
75+ # See https://symfony.com/doc/current/testing/http_authentication.html
76+ security :
77+ firewalls :
78+ main :
79+ http_basic : ~
0 commit comments