2

I have created an API that uses the FOSUserBundle and the FOSOAuthServerBundle for user accounts and Authorization.

Is it possible to add, login via facebook or google, functionality using the FOSOAuthServerBundle?

I have seen people mentioning the HWIOAuthBundle as a way to integrate Facebook and other social logins. I have not seen an example of integrating the two bundles (FOSOAuthServer and HWIOAuth) so that users can create accounts on the system and authenticate (FOS) while at the same time being able to create accounts / login via FB (HWIO).

Shawn Northrop
  • 5,826
  • 6
  • 42
  • 80
  • Did you find a solution for this? I am trying to set up a similar system. Found two sources that might help: http://stackoverflow.com/questions/28176629/how-to-use-google-oauth-as-autentification-for-symfony2-rest-api and http://stackoverflow.com/questions/4574868/securing-my-rest-api-with-oauth-while-still-allowing-authentication-via-third-pa?rq=1 – bblue Mar 16 '16 at 09:40
  • Thanks for those sources.. I found a post that seemed to explain how to integrate facebook or other 3rd party logins... I linked it in my answer below – Shawn Northrop Mar 16 '16 at 17:19

1 Answers1

-1

I found this post about using custom grant types with FOSOAuthBundle:

http://blog.tankist.de/blog/2013/08/20/oauth2-explained-part-4-implementing-custom-grant-type-symfony2-fosoauthserverbundle/

The idea is to create a service that takes the facebook token and validates it with facebook. If successful an OAuth Token should be returned.

The HWIOBundle is not necessary

Shawn Northrop
  • 5,826
  • 6
  • 42
  • 80
  • do you use a specific bundle to validate the token with facebook ? , what if token expired ? – MoxGeek Jan 19 '18 at 13:26
  • No specific bundle. Facebook has documentation on validating tokens, which checks if expired, and on validation returns a FB user Id. I ended up creating users in my system which have a FB id along with their own User Id (For my system) and other properties. – Shawn Northrop Jan 19 '18 at 17:56