Repository navigation
Expand file tree
/
Copy pathsecurity.php
More file actions
44 lines (36 loc) · 1.45 KB
/
Copy pathsecurity.php
File metadata and controls
44 lines (36 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
declare(strict_types=1);
return <<<YAML
# see https://github.com/symfony/recipes/blob/master/symfony/security-bundle/3.3/config/packages/security.yaml
security:
encoders:
MsgPhp\User\Infra\Security\SecurityUser: ${hashAlgorithm}
# https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
providers:
in_memory: { memory: ~ }
msgphp_user: { id: MsgPhp\User\Infra\Security\SecurityUserProvider }
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
anonymous: true
provider: msgphp_user
# activate different ways to authenticate
# http_basic: true
# https://symfony.com/doc/current/security.html#a-configuring-how-your-users-will-authenticate
# https://symfony.com/doc/current/security/form_login_setup.html
form_login:
login_path: /login
check_path: /login
default_target_path: /profile
username_parameter: ${fieldName}
password_parameter: password
logout:
path: logout
# 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: IS_AUTHENTICATED_FULLY }
YAML;