security:
    # https://symfony.com/doc/current/security/authenticator_manager.html
    enable_authenticator_manager: false
    # https://symfony.com/doc/current/security.html#c-hashing-passwords
    password_hashers:
        # Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'auto'
        App\Entity\SsoUser:
            algorithm: bcrypt
            # algorithm: plaintext

    # 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)
        sso_user_provider:
            entity:
                class: App\Entity\SsoUser
                property: username
    firewalls:
        dev:
            pattern: ^/(_(profiler|wdt)|css|images|js)/
            security: false
        # api_token:
        #     pattern: ^/api/token$
        #     security: false
        api:
            pattern: ^/api
            security: true
            stateless: true
            oauth2: true
        n_api:
            pattern: ^/n_api
            security: true
            stateless: true
            oauth2: true
        main_sso:
            # lazy: true
            provider: sso_user_provider
            anonymous: true
            lazy: true
            guard:
                authenticators:
                    - App\Security\LoginFormAuthenticator
            logout:
                path: app_logout
                # where to redirect after logout
                target: app_login

            # 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_INFO }
        - { path: ^/portal/aspirante/registry, roles: PUBLIC_ACCESS }
        - { path: ^/portal/aspirante/descarga/reglamento, roles: PUBLIC_ACCESS }
        - { path: ^/portal/aspirante/registro, roles: PUBLIC_ACCESS }
        - { path: ^/notificacion/notificacion/usuario, roles: IS_AUTHENTICATED_REMEMBERED }
        - { path: ^/notificacion, roles: ROLE_AMB_NOTIFICACIONES }
        - { path: ^/portal, roles: IS_AUTHENTICATED_REMEMBERED }
        - { path: ^/authorize, roles: IS_AUTHENTICATED_REMEMBERED }
