security.yml 1.39 KB
# To get started with security, check out the documentation:
# http://symfony.com/doc/current/book/security.html
security:
    encoders:
        AppBundle\Entity\Usuarios:
            algorithm: bcrypt

    # http://symfony.com/doc/current/book/security.html#where-do-users-come-from-user-providers
    providers:
            our_db_provider:
                entity:
                    class: AppBundle:Usuarios
                    property: username

    firewalls:
        main:
            anonymous: ~
            http_basic: ~
            provider: our_db_provider
            form_login:
                login_path: /login
                check_path: /login
                csrf_token_generator: security.csrf.token_manager
            logout:
                path:   /logout
                target: /


            # activate different ways to authenticate

            # http_basic: ~
            # http://symfony.com/doc/current/book/security.html#a-configuring-how-your-users-will-authenticate

            # form_login: ~
            # http://symfony.com/doc/current/cookbook/security/form_login_setup.html
    access_control:
        - { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/register, roles: ROLE_DOCENTE }
        - { path: ^/ceapp, roles: ROLE_DOCENTE }
        - { path: ^/admin, roles: ROLE_ADMINISTRADOR }
        - { path: ^/, roles: IS_AUTHENTICATED_ANONYMOUSLY }