magnetico-web/config/packages/security.yaml

45 lines
1.4 KiB
YAML
Raw Normal View History

2018-06-23 15:00:37 +00:00
security:
# https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
providers:
2018-06-25 01:02:27 +00:00
app_db_provider:
entity:
class: App\Entity\User
property: username
manager_name: default
encoders:
App\Entity\User:
algorithm: 'argon2i'
memory_cost: 16384
time_cost: 2
threads: 4
2018-06-23 15:00:37 +00:00
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
2018-06-25 01:02:27 +00:00
api:
pattern: ^/api/
2018-06-23 15:00:37 +00:00
anonymous: true
2018-06-25 01:02:27 +00:00
main:
pattern: ^/
anonymous: ~
provider: app_db_provider
form_login:
login_path: user_login
check_path: user_login
logout:
path: user_logout
target: /
remember_me:
secret: '%kernel.secret%'
lifetime: 604800
path: /
always_remember_me: true
2018-06-23 15:00:37 +00: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:
2018-06-25 01:02:27 +00:00
- { path: ^/$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: /login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/, roles: ROLE_USER }