我有网络服务,它是我的“普通”用户的提供者。我想为我的管理员使用 FosUserBundle。以上是我的安全配置。普通用户登录没有问题,但是当我想以管理员身份登录时,我收到了以下消息:
“您必须在安全防火墙配置中使用 form_login 配置防火墙处理的检查路径。”
这是我的安全配置:
security:
encoders:
Locastic\CustomUserBundle\Security\User\User: plaintext
FOS\UserBundle\Model\UserInterface: sha512
providers:
fos_userbundle:
id: fos_user.user_provider.username_email
webservice:
id: locastic.user_provider
firewalls:
main:
pattern: ^/admin
form_login:
provider: fos_userbundle
login_path: fos_user_security_login
check_path: fos_user_security_check
csrf_provider: form.csrf_provider
logout: true
anonymous: true
remember_me:
key: "%secret%"
lifetime: 31536000 # 365 days in seconds
path: /
domain: ~ # Defaults to the current domain from $_SERVER
user-service:
pattern: ^/
logout:
path: /logout
anonymous: true
webservice-login:
check_path: /prijava-provjera
login_path: /prijavi-se
provider: webservice
always_use_default_target_path: true
default_target_path: /stanje-racuna
access_control:
- { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/admin, role: ROLE_ADMIN }
role_hierarchy:
ROLE_ADMIN: ROLE_USER
ROLE_SUPER_ADMIN: ROLE_ADMIN