Skip to content

Instantly share code, notes, and snippets.

@Kim-Vallee
Last active July 8, 2018 11:36
Show Gist options
  • Save Kim-Vallee/57a70ac5142cc082289b2ae5c7569894 to your computer and use it in GitHub Desktop.
Save Kim-Vallee/57a70ac5142cc082289b2ae5c7569894 to your computer and use it in GitHub Desktop.
#index:
# path: /
# controller: App\Controller\DefaultController::index
logout:
path: /logout
security:
# https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
providers:
in_memory: { memory: ~ }
db_provider:
entity:
class: App\Entity\Adherent
property: email
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
pattern: ^/
anonymous: ~
http_basic: ~
provider: db_provider
form_login:
login_path: login
check_path: login
logout:
path: logout
target: homepage
# activate different ways to authenticate
# http_basic: true
# https://symfony.com/doc/current/security.html#a-configuring-how-your-users-will-authenticate
# form_login: true
# https://symfony.com/doc/current/security/form_login_setup.html
# 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 }
# - { path: ^/profile, roles: ROLE_USER }
encoders:
Symfony\Component\Security\Core\User\User:
algorithm: bcrypt
cost: 12
App\Entity\Adherent:
algorithm: bcrypt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment