-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Closed
Labels
DXDX = Developer eXperience (anything that improves the experience of using Symfony)DX = Developer eXperience (anything that improves the experience of using Symfony)Security
Description
Description
If your firewall has two authenticators (ie form_login & remember_me), when using Security::login() you are required to pass the authenticator name. If you don't, you get the following exception:
Too many authenticators were found for the current firewall "main". You must provide an instance of "AuthenticatorInterface" to login programmatically. The available authenticators for the firewall "main" are "security.authenticator.form_login.main" ,"security.authenticator.remember_me.main".
This requires your code to have knowledge of your config. I'd like to suggest the ability to set a default authenticator for the firewall.
Example
security:
firewalls:
main:
default_authenticator: form_login # new config option
form_login: ~
remember_me: ~$security->login($user);santysisisantysisi and LalainaAndrianarimalalasantysisi
Metadata
Metadata
Assignees
Labels
DXDX = Developer eXperience (anything that improves the experience of using Symfony)DX = Developer eXperience (anything that improves the experience of using Symfony)Security