Part-DB.Part-DB-server/config/packages/security.yaml

46 lines
1.5 KiB
YAML
Raw Normal View History

2019-02-23 16:49:38 +01:00
security:
encoders:
App\Entity\UserSystem\User:
algorithm: auto
2019-02-23 16:49:38 +01:00
# 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)
app_user_provider:
entity:
class: App\Entity\UserSystem\User
property: name
2019-02-23 16:49:38 +01:00
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
anonymous: true
# activate different ways to authenticate
2019-02-23 16:49:38 +01:00
#http_basic: true
# https://symfony.com/doc/current/security.html#a-configuring-how-your-users-will-authenticate
2019-02-23 16:49:38 +01:00
# https://symfony.com/doc/current/security/form_login_setup.html
form_login:
login_path: login
check_path: login
csrf_token_generator: security.csrf.token_manager
use_referer: true
default_target_path: '/'
logout:
path: logout
target: homepage
2019-02-23 16:49:38 +01:00
remember_me:
secret: '%kernel.secret%'
lifetime: 2592000 # 30 days in seconds
2019-02-23 16:49:38 +01:00
# 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 }