security:
    encoders:
        bcrypt:
            algorithm: bcrypt
            cost: 12

        md5:
            algorithm: md5
            encode_as_base64: false
            iterations: 1

    providers:
        novosga_provider:
            entity:
                class: Novosga\Entity\Usuario
                property: login

    firewalls:
        dev:
            pattern: ^/(_(profiler|wdt)|css|images|js)/
            security: false

        oauth_token:
           pattern:    ^/api/token
           security:   false
            
        api:
           pattern:    ^/(api|\w+\.\w+/api)
           fos_oauth:  true
           stateless:  true
           anonymous:  false

        main:
            anonymous: true
            pattern: ^/
            guard:
                authenticators:
                    - App\Security\LoginAuthenticator
            logout:
                path:   /logout
                target: /

    access_control:
        - { path: ^/(api|\w+\.\w+/api), roles: [ IS_AUTHENTICATED_FULLY ] }
        - { path: ^/login, roles: [ IS_AUTHENTICATED_ANONYMOUSLY ] }
        - { path: ^/admin, roles: [ ROLE_ADMIN ] }
        - { path: ^/,      roles: [ ROLE_USER ] }


    access_decision_manager:
        strategy: affirmative