Как я могу использовать две формы входа в security.yml, я не знаю, возможно ли, что я хочу использовать провайдеров: in_memory и fosuserbundle с двумя формами входа.
security: кодировщики: FOS \ UserBundle \ Model \UserInterface: bcrypt Symfony \ Component \ Security \ Core \ User \ User: алгоритм: стоимость bcrypt: 12
role_hierarchy:
ROLE_ADMIN: ROLE_USER
ROLE_SUPER_ADMIN: ROLE_ADMIN
providers:
in_memory:
memory:
users:
'admin@turizmehli.com':
password: '$2y$12$GbKR8LI7tOP4zZ0Mt.sui.4r2ZNtrk1H/1z0kX0yHxWoxXOL6EZj.'
roles: 'ROLE_ADMIN'
fos_userbundle:
id: fos_user.user_provider.username
firewalls:
main:
pattern: ^/
form_login:
provider: fos_userbundle
csrf_token_generator: security.csrf.token_manager
# if you are using Symfony < 2.8, use the following config instead:
# csrf_provider: form.csrf_provider
logout: true
anonymous: true
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
admin:
host: '%DOMAIN_ADMIN%'
form_login:
provider: in_memory
login_path: admin_login
check_path: admin_login
always_use_default_target_path: true
default_target_path: admin_home
csrf_token_generator: security.csrf.token_manager
csrf_parameter: _token
logout:
path: admin_logout
anonymous: ~
api:
host: '%DOMAIN_API%'
pattern: ^/.+
stateless: true
anonymous: true
access_control:
# Admin access rules
- { path: ^/login, host: '%DOMAIN_ADMIN%', roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/, host: '%DOMAIN_ADMIN%', roles: ROLE_USER }
# Default all request denied if not whitelisted
- { path: ^/, role: NO_ACCESS }
- { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/post, role: IS_AUTHENTICATED_ANONYMOUSLY }