security:
    role_hierarchy:
        ROLE_ADMIN:       ROLE_USER
        ROLE_SUPER_ADMIN: ROLE_ADMIN
    encoders:
        App\Entity\User\User:
            algorithm: auto
    # https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
    providers:
        # used to reload user from session & other features (e.g. switch_user)
        app_user_provider:
            entity:
                class: App\Entity\User\User
                property: username
    firewalls:
        dev:
            pattern: ^/(_(profiler|wdt)|css|images|js)/
            security: false
        #token:
        #    anonymous: true
        #    pattern: ^/authce/
        #    guard:
        #        authenticators:
        #            - App\Security\TokenAuthenticator
        #    logout:
        #        path: logout
        main:
            anonymous: true
            guard:
                authenticators:
                    - App\Security\UserAuthenticator
                    - App\Security\TokenAuthenticator
                entry_point: App\Security\UserAuthenticator

            logout:
                path: logout

    access_control:
        - { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/authce, roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/rest/trial, roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/, roles: ROLE_USER }
