Reputation: 11
Is it possible to override authentication of FOSUserBundle
. I need to authenticate users by user/password and additional third field, remember it in token for further use in ACL.
Upvotes: 1
Views: 625
Reputation: 11
So, I dealt with it. If it will useful for somebody: you should override login template, implement SimpleFormAuthenticatorInterface(available in Symfony 2.4.*) and if you want to store some data you should to create your own Token(for it i extended last from UserPasswordToken and override some parts). Also you should replace form_login with simple_from in your firewall(security.yml).
Upvotes: 0
Reputation: 6379
You have to override the login template, and (maybe) create an own login routine. Would explode the range of this Post, to explain that - You can find more informations here:
https://github.com/FriendsOfSymfony/FOSUserBundle/blob/master/Resources/doc/overriding_templates.md
EDIT: Almost every Bundle for Symfony2 has a good documentation. Always check there!
Upvotes: 1