I'm playing with EasyAdminBundle and now I am trying to setup the security via form login from FOS UserBundle. However, it does not really work. Instead of being successfully logged in, I always get redirected to the "failure_path" in the security.yml. What I want:
- hit /easy-admin
- get redirected to the FOS standard login form /easy-admin/login
- login with my username and password (I know the credentials are ok)
- See the admin "index" on /easy-admin
So here is my security.yml config:
providers:
fos_userbundle:
id: fos_user.user_provider.username
firewalls:
easy_admin:
pattern: ^/easy-admin
context: user
form_login:
provider: fos_userbundle
csrf_provider: security.csrf.token_manager
login_path: fos_user_security_login
check_path: fos_user_security_check
failure_path: /
default_target_path: /easy-admin
anonymous: ~
logout:
path: /logout
target: /easy-admin/login
access_control:
- { path: ^/easy-admin/login, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/easy-admin, role: ROLE_SUPER_ADMIN }
My routing.yml looks like this:
easy_admin_bundle:
resource: "@EasyAdminBundle/Controller/"
type: annotation
prefix: /easy-admin
fos_user_security:
resource: "@FOSUserBundle/Resources/config/routing/security.xml"
prefix: /easy-admin
fos_user_profile:
resource: "@FOSUserBundle/Resources/config/routing/profile.xml"
prefix: /easy-admin/profile
fos_user_register:
resource: "@FOSUserBundle/Resources/config/routing/registration.xml"
prefix: /easy-admin/register
fos_user_resetting:
resource: "@FOSUserBundle/Resources/config/routing/resetting.xml"
prefix: /easy-admin/resetting
fos_user_change_password:
resource: "@FOSUserBundle/Resources/config/routing/change_password.xml"
prefix: /easy-admin/profile
So what now happens so far is: I can hit /easy-admin, I get redirected to /easy-admin/login and see the very basic login form. After providing the information and submitting the form, I get redirected to the failure route. Again: I know that the credentials I am using are correct! Any ideas what is missing or what else I can look for? For now I don't have my own AuthHandler but I thought this is not mandatory to make a basic login with session work. Thanks