security:
    enable_authenticator_manager: true
    encoders:
        FindMyDataBundle\Security\Worker:
            algorithm: argon2i

    # https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
    providers:
        users_in_memory: { memory: null }
        app_key_user_provider:
            id: FindMyDataBundle\Security\UserProvider
    firewalls:
        dev:
            pattern: ^/(_(profiler|wdt)|css|images|js)/
            security: false
        main:
            lazy: true
            provider: app_key_user_provider
            stateless: false
            guard:
                authenticators:
                    - FindMyDataBundle\Security\LoginFormAuthenticator
                entry_point: FindMyDataBundle\Security\LoginFormAuthenticator
            logout:
                # A changé après, je l'ai modif pour TMA
                path: main_logout_fr
                # Delete_cookies from Symfony 3.1, still working though
                delete_cookies:
                    REMEMBERME: { path: null, domain: null}
                # path: main_logout_tma_fr
                # where to redirect after logout
                # target: main_home_ph_fr
                # invalidate_session: true
            remember_me:
                secret:   '%kernel.secret%'
                lifetime: 15768000 # 6 months # 604800 # 1 week in seconds
                path:     /
                # secure: true
                httponly: true
                # by default, the feature is enabled by checking a
                # checkbox in the login form (see below), uncomment the
                # following line to always enable it.
                #always_remember_me: true

            # 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:
        - { path: ^/se-connecter, roles: IS_AUTHENTICATED_ANONYMOUSLY }
        # - { path: ^/profile, roles: ROLE_USER }
