Closed
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);