# To get started with security, check out the documentation:
# https://symfony.com/doc/current/security.html
security:
    encoders:
        AppBundle\Entity\User:
          algorithm: bcrypt

    # https://symfony.com/doc/current/security.html#b-configuring-how-users-are-loaded
    providers:
        db_provider:
            entity:
                class: AppBundle:User
                property: username

    firewalls:
        # disables authentication for assets and the profiler, adapt it according to your needs
        dev:
            pattern: ^/(_(profiler|wdt)|css|images|js)/
            security: false

        main:
            anonymous: ~
            # activate different ways to authenticate

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

            # https://symfony.com/doc/current/security/form_login_setup.html
            form_login:
                login_path: login
                check_path: login

            logout:
                path: /logout
                target: /

    access_control:
        - { path: ^/admin/, roles: IS_AUTHENTICATED_FULLY }