Question

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.

Was it helpful?

Solution 2

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).

OTHER TIPS

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!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top