Search code examples
facebookscalaplayframework-2.2securesocial

How implement UserServicePlugin for facebook in play 2 with securesocialplugin?


I need implement facebook UserServicePlugin for workin with facebook, I need not registration, application only need registration through facebook, I found only examples for in memory service, but not found any example for working with facebook, it there any example?


Solution

  • If you only need Facebook then just enable the FacebookProvider in the module. To do that only add the provider in the play.plugins file (for the 2.1.x versions) or in your RuntimeEnvironment implementation (master as of this writing).

    The UserService is in charge of persisting the users, it does not matter what provider authenticated them.

    In your case you can take the InMemoryUserService as a base and modify it to persist users in the database you plan to use.