Log with CPF in Fosuserbundle

Asked

Viewed 17 times

1

Fosuserbundle by default connects with email or username and password. But I want to change to CPF and password.

I created Cpfprovider, I wrote some classes, but I’m having to practically overwrite the whole Fosuserbundle to work.

  • Hi Bruno, share your code, there are so many setup options of Fosuserbundle that it is difficult to give you practical advice. In theory it seems to me that you could inherit from User and simply use Cpf from the userName correct? You make a point of hiding the mapping of userName for the CPF? If not I would leave everything as it is and just add a public function getCpf() pointing to userName.

  • To overwrite the username and persist it in a column cpf use the annotationAttributeOverride of Doctrine (see an example)

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.