0
你好,我有与fosuserbundleERRO-您必须配置支票路径通过在您的安全防火墙配置使用form_login防火墙处理
symfony项目的一个问题,当我做登录我给这个错误
You must configure the check path to be handled by the firewall using form_login in your security firewall configuration.
我尝试不同的代码,总是得到一些错误
我使用:
的symfony 3 FOSUserBundle 2.0
config.yml
fos_user:
db_driver: orm # other valid values are 'mongodb' and 'couchdb'
firewall_name: main
user_class: AppBundle\Entity\User
from_email:
address: "[email protected]"
sender_name: "Test App"
路由
app:
resource: '@AppBundle/Controller/'
type: annotation
admin_area:
resource: "@SonataAdminBundle/Resources/config/routing/sonata_admin.xml"
prefix: /admin
fos_user:
resource: "@FOSUserBundle/Resources/config/routing/all.xml"
安全
# To get started with security, check out the documentation:
# https://symfony.com/doc/current/security.html
security:
# https://symfony.com/doc/current/security.html#b-configuring-how-users-are-loaded
providers:
in_memory:
memory: ~
firewalls:
# disables authentication for assets and the profiler, adapt it according to your needs
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
anonymous: ~
# activate different ways to authenticate
# https://symfony.com/doc/current/security.html#a-configuring-how-your-users-will-authenticate
#http_basic: ~
# https://symfony.com/doc/current/security/form_login_setup.html
#form_login: ~
encoders:
FOS\UserBundle\Model\UserInterface: bcrypt
role_hierarchy:
ROLE_ADMIN: ROLE_USER
ROLE_SUPER_ADMIN: ROLE_ADMIN
providers:
fos_userbundle:
id: fos_user.user_provider.username
firewalls:
main:
pattern: ^/admin
form_login:
login_path: /login
check_path: /login_check
provider: fos_userbundle
csrf_provider: form.csrf_provider
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 }
在这个项目中我用的是sonata管理软件包,能干吗?
希望一些帮助THX