12

I am using Play2 with scala. I am new in Play2 and scala. I need authentication and authorization in a project. So which is the best for me from following? And why?

  1. Play2-Auth
  2. SecureSocial
  3. Deadbolt2

Is any one like a Spring security? I need authorization based on a user role and also need social login like google+, facebook and twitter and also our own side login.

So please tell me the best solution for me. And also explain why it best?

Daniel Olszewski
  • 13,995
  • 6
  • 58
  • 65
Dinesh Maske
  • 199
  • 1
  • 1
  • 11
  • 2
    James Roper (Tech lead play) mentions here (https://groups.google.com/d/msg/play-framework/pobbEu-dduY/tJT_BnpHQy8J) that there is inclination towards Deadbolt2 to be included in play in future. So +1 to deadbolt2 – Jatin Sep 11 '14 at 07:06
  • 1
    I was about to ask this question myself. – Felipe Oct 07 '14 at 17:27
  • 1
    There's also Silhouette. It's got nearly 400 commits on github and it looks like it's very actively mantained. – Felipe Oct 07 '14 at 18:07
  • (On Silhouette's project page, it is called an *Authentication* framework - not sure whether that means it doesn't do authorization as well) – Felipe Oct 07 '14 at 18:21
  • [play-pac4](https://github.com/pac4j/play-pac4) should also be part of the conversation. I've used it to add Google authentication to a web site but don't know how it compares to these others. – Robert Fleming Mar 24 '17 at 22:38

1 Answers1

6

Deadbolt2 is only an Authorization framework. Play2-Auth and SecureSocial both do Authentication and Authorization but their Authorization capabilities are much weaker than Deadbolt2. Play2-Auth does not have social login capabilities (that I know of). SecureSocial does.

I am using SecureSocial for the exact use case you are mentioning: social and local logins with role-based authorization. It works well for my purposes. I am using the current stable version (2.1.4 for Play 2.2.x) but be advised that the next version (that supports Play 2.3.x) is quite different and the upgrade procedure is painful. I have tried it once and have given up on it for the time being.

Igor Rumiha
  • 407
  • 3
  • 10
  • Any idea if there are docs or a tutorial somewhere for the forthcoming 3.0 version? – plamb Feb 19 '15 at 21:32
  • Not that I know of. There is a high-level overview of the new 3.0 features here: https://groups.google.com/d/msg/securesocial/AEnf2McpQXY/JQV85uRKBQwJ but no tutorial. – Igor Rumiha Feb 20 '15 at 10:03