security:
    encoders:
        App\Entity\PackageSecurity\User:
            algorithm: auto
    
    role_hierarchy:
        ROLE_ADMIN:         ROLE_USER
        ROLE_SUPER_ADMIN:   ROLE_ADMIN

    # https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
    providers:
        #in_memory: { memory: ~ }
        in_database: 
            entity:
                class: App\Entity\PackageSecurity\User
                property: username
    firewalls:
        dev:
            pattern: ^/(_(profiler|wdt)|css|images|js)/
            security: false
        main:
            anonymous: true
            
            provider: in_database

            form_login:
                login_path: app_login
                check_path: app_login
                default_target_path: default_target_path

            logout:
                path: app_logout
                target: app_login

            guard:
                authenticators:
                    - App\Security\PackageSecurity\LoginFormAuthenticator

            # activate different ways to authenticate

            # http_basic: true
            # https://symfony.com/doc/current/security.html#a-configuring-how-your-users-will-authenticate

            # form_login: true
            # https://symfony.com/doc/current/security/form_login_setup.html

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