i have webservice which is provider for my \"regular\" users. I want to use FosUserBundle for my administrators. Above is my security configuration. regular users login work
Your code is wrong only in the part of check_path value.
This is your original code:
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
And you should use something like:
firewalls:
main:
pattern: ^/admin
form_login:
provider: fos_userbundle
login_path: fos_user_security_login
check_path: /login_check
csrf_provider: form.csrf_provider
logout: true
anonymous: true
Note that check_path has as value only a string. If you use the value fos_user_security_check you are calling to SecurityController.php class and invoking the checkAction() method which exactly only throws an RuntimeError Exception with the error displayed "You must configure the check path to be handled by the firewall using form_login in your security firewall configuration.". So the fix is so simple that not use the value fos_user_security_check