2018-04-04 16:25:25 +02:00
|
|
|
# To get started with security, check out the documentation:
|
|
|
|
# https://symfony.com/doc/current/security.html
|
|
|
|
security:
|
|
|
|
encoders:
|
|
|
|
FOS\UserBundle\Model\UserInterface: bcrypt
|
|
|
|
# https://symfony.com/doc/current/security.html#b-configuring-how-users-are-loaded
|
|
|
|
providers:
|
|
|
|
fos_userbundle:
|
|
|
|
id: fos_user.user_provider.username
|
|
|
|
firewalls:
|
2018-04-25 14:47:31 +02:00
|
|
|
secured_area:
|
2018-05-04 17:04:13 +02:00
|
|
|
pattern: ^/
|
2018-04-25 14:47:31 +02:00
|
|
|
anonymous: ~
|
|
|
|
logout_on_user_change: true
|
2018-05-04 17:04:13 +02:00
|
|
|
form_login:
|
|
|
|
provider: fos_userbundle
|
|
|
|
csrf_token_generator: security.csrf.token_manager
|
|
|
|
default_target_path: dashboard
|
2018-04-25 17:38:45 +02:00
|
|
|
logout:
|
|
|
|
path: /logout
|
|
|
|
target: /login
|
2018-05-04 17:04:13 +02:00
|
|
|
anonymous: true
|
|
|
|
logout_on_user_change: true
|
2018-04-25 14:47:31 +02:00
|
|
|
oauth:
|
|
|
|
resource_owners:
|
|
|
|
google: "/login/check-google"
|
|
|
|
disqus: "/login/check-disqus"
|
|
|
|
twitter: "/login/check-twitter"
|
|
|
|
login_path: /login
|
|
|
|
use_forward: false
|
|
|
|
failure_path: /login
|
|
|
|
|
|
|
|
oauth_user_provider:
|
2018-04-25 15:08:39 +02:00
|
|
|
service: my.custom.user_provider
|
2018-04-04 16:25:25 +02:00
|
|
|
# disables authentication for assets and the profiler, adapt it according to your needs
|
|
|
|
dev:
|
|
|
|
pattern: ^/(_(profiler|wdt)|css|images|js)/
|
|
|
|
security: false
|
2018-04-18 14:39:15 +02:00
|
|
|
# https://symfony.com/doc/current/security/form_login_setup.html
|
2018-04-04 16:25:25 +02:00
|
|
|
# activate different ways to authenticate
|
|
|
|
# https://symfony.com/doc/current/security.html#a-configuring-how-your-users-will-authenticate
|
|
|
|
#http_basic: ~
|
|
|
|
role_hierarchy:
|
|
|
|
ROLE_ADMIN: ROLE_USER
|
|
|
|
ROLE_SUPER_ADMIN: ROLE_ADMIN
|
|
|
|
|
|
|
|
access_control:
|
2018-04-17 14:52:31 +02:00
|
|
|
- { path: ^/dashboard$, role: IS_AUTHENTICATED_REMEMBERED }
|
2018-04-04 16:25:25 +02:00
|
|
|
- { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
|
|
|
|
- { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
|
|
|
|
- { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
|
|
|
|
- { path: ^/admin/, role: ROLE_ADMIN }
|