Search code examples
phpfacebooksymfonyauthenticationlinkedin-api

Symfony 2.8: Linkedin & Facebook authentication without FOSUserBundle


My application should be using 3 types of sign up/in: simple form, linkedin, facebook.

My Entity is implementing UserInterface, \Serializable which means I am not using FOSUserBundle, because my registration is customized by my needs. I have already finished sign up/in forms and is working perfectly according my needs.

When I am googling the isue about authentication via linkedin and facebook in Symfony, I get bundles that uses FOSUserBundle (i.e. HWIOAuthBundle). Should I start creating linkedin and facebook authentication using FOSUserBundle and keep form authentication without, or is there a possibility to not use FOSUserBundle?

Thank you in advance!


Solution

  • Use HWIOAuthBundle. It does not require FOSUserBundle. It allows you to also use with FOSUserBundle, which you're not wanting so just ignore that part of the documentation.

    I would have added this as a comment, but I don't have enough reputation yet.

    I would also encourage you to look at the Guard component of Symfony as of 2.8. Before 2.8 it was supplied as a bundle. Here it is: https://symfony.com/doc/current/cookbook/security/guard-authentication.html#main

    I'm not sure it will be helpful to you, but hope one of the above will help you along your journey.