security:
    encoders:
        App\Entity\User:
            algorithm:   bcrypt
    #            memory_cost:  16384 # Amount in KiB. (16384 = 16 MiB)
    #            time_cost:    2     # Number of iterations
    # https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
    providers:
        #users_in_memory: { memory: null }
        users:
            entity:
                # the class of the entity that represents users
                class: 'App\Entity\User'
                # the property to query by - e.g. username, email, etc
                property: 'email'
    firewalls:
        dev:
            pattern: ^/(_(profiler|wdt)|css|images|js)/
            security: false
        main:
#            anonymous: lazy  20 07 2020
            anonymous: true
            lazy: true
            #            provider: users
            #            user_checker: security_login
            guard:
                authenticators:
                    - App\Security\LoginFormAuthenticator
            logout:
                path: security.logout

            # 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: ^/admin, roles: ROLE_ADMIN }
        #-  { path: ^/profile, roles: ROLE_USER }
        -  { path: ^/login$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
