security:
    # https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
    providers:
        # the name of your user provider can be anything
        session_user_provider:
            id: App\Security\AuthUserProvider
#        secured_area:
#            id: session_auth.user_provider
    firewalls:

        dev:
            stateless: true
            access_denied_handler: App\Security\AccessDeniedHandler
            guard:
               authenticators:
                    - App\Security\SessionAuthenticator
        main:
            stateless: true
            access_denied_handler: App\Security\AccessDeniedHandler
            guard:
                authenticators:
                    - App\Security\SessionAuthenticator
            # 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

#        secured_area:
#            guard:
#                authenticators:
#                    - session_auth.authenticator
#            logout:
#                path:   logout #nom de la route de déconnexion
#                target: /
#                success_handler: session_auth.authenticator

    encoders:
    # use your user class name here
        App\Security\AuthUser:
        # Use native password encoder
        # This value auto-selects the best possible hashing algorithm
        # (i.e. Sodium when available).
            algorithm: auto
    # Easy way to control access for large sections of your site
    # Note: Only the *first* access control that matches will be used
    access_control:
         - { path: '^/admin-test/admin', roles: ROLE_ADMIN }
         - { path: '^/admin-test/unauthorized', roles: ROLE_USER }
         - { path: '^/admin-test/page1', roles: ROLE_USER_CONNECTED }
         - { path: '^/admin-test', roles: ROLE_USER }
