13
votes

I've been learning a lot of good stuff with Play Framework and had one more question before I keep moving. I'm looking for a detailed tutorial like the one on this link:

http://www.playframework.org/documentation/1.2.4/guide8

But for Play Framework 2.0 - 2.0.1. I just need to add Authentication to my site. I'm a beginner on this Play world and wanted to learn in a guide like the mention before implementing in my app.

Anyone knows where is that link I'm looking for? My Google skills gave up.

5
You should have a link a the Zentasks sample, there they have implemented authentication. They are working on a module, but I do not know if it is done yet. - adis
I didn't know where that zentasks was. Thank you for the help! I see the sample directory in the play zip. - mimoralea
there are some play plugins for authentication. I personally didn't like them much, but they work fine. In case you want to understand how auth should work, hope this helps: pedrorijo.com/blog/scala-play-auth - pedrorijo91

5 Answers

16
votes

Check out the samples in the play folder. There is one handling authentification/authorization : zentasks if I remember right.

11
votes

For anyone interested this module is good for OAuth2.0 authentication in play framework 2.0 http://joscha.github.com/play-authenticate/

from the site: play-authenticate is meant to be used with java apps, and by examination of the sample usage app, the deadbolt integration is geared towards java usage as well. i don't think this is the most idiomatic choice for scala apps.

4
votes

Check out the module for Play 2.0: https://github.com/t2v/play20-auth

afaict, this is the best choice for scala apps that need more full-featured auth support than comes with the framework, as of Nov 2012.

2
votes

Another good option seems to be SecureSocial.ws. It seems to me the most complete framework currently (mid of 2013).

Still, in all cases I think too much code is required, at least if you are used to Spring Security.

2
votes

FWIW, there is now an excellent walkthrough of the construction of zentasks, with the login/authentication described here:

http://www.playframework.com/documentation/2.2.x/JavaGuide4

I'm not saying it shows how to do best practice authentication, just a good beginners example of how to put simple authentication in place.