I would like to add my FOSUser login method on my security.yml, because I use a authentication CAS, but I want an authentication with a login-form on my homepage (with User table on database which is different to User from CAS authentication)
So I configured my security.yml like this :
# app/config/security.yml
security:
encoders:
FOS\UserBundle\Model\UserInterface: bcrypt
role_hierarchy:
ROLE_ADMIN: ROLE_USER
ROLE_SUPER_ADMIN: ROLE_ADMIN
providers:
app:
id: bes_auth.user_provider
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
# anonymous: true
public:
pattern: ^accueil
security: false
anonymous: true
main:
logout_on_user_change: true
pattern: ^/(admin|profile|packages|securiteInformatique|logout)
# pattern: ^/(?!accueil)
guard:
authenticators:
- app.security.login_form_authenticator:
check_path: fos_user_check_path
- bes_auth.authenticator
entry_point: Site\PagesBundle\Security\LoginFormAuthenticator
logout:
path: deconnexion #nom de la route de déconnexion
target: /
success_handler: bes_auth.authenticator
anonymous: true
access_control:
- { path: ^/admin, role: ROLE_SUPER_ADMIN }
- { path: ^/accueil, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/, role: ROLE_USER }
But I've this error now :
Invalid type for path "security.firewalls.main.guard.authenticators.0". Expected scalar, but got array.
It's about :
guard:
authenticators:
- app.security.login_form_authenticator:
check_path: fos_user_check_path
- bes_auth.authenticator
entry_point: Site\PagesBundle\Security\LoginFormAuthenticator
But I don't see what's wrong, can someone help me please ?