nicowernli
nicowernli

Reputation: 3348

Users management with Play! Framework 2.0.3

I'm a complete newbie with Play! I'm a Django developer and I started using Play! a few days ago. I can't find information on how to register new users to my application. I don't want to use OAuth, I just want to manage users in my own database with passwords encryption. By the way, I'm using Java version.

Upvotes: 7

Views: 6915

Answers (1)

biesior
biesior

Reputation: 55798

There is nothing ready yet, however I'd suggest you to use play-authenticate (live demo) as a base.

That's currently the most advanced solution for Play 2 for authentication and authorization. It combines deadbolt-2 for authorization (roles and permissions) + own authentication which makes it very comfortable stack to start with.

Although its base idea is deliver a way for authenticating users with OAuth - the providers are a configurable options, so you can disable it and base on e-mail provider only.

Note important for you it... hasn't build-in user management, however I can ensure you that in current state it requires adding just several actions to create what you need. I'm doing it in few of my projects and soon will send a pull request with that changes.

Edit: By default all providers are enabled with dummy credentials, of course it will fail to run. You need to disable them in conf/play.plugins (by just removing unwanted lines) most probably you have to keep only these lines to keep deadbolt + PA with mailer:

1500:com.typesafe.plugin.CommonsMailerPlugin
10000:be.objectify.deadbolt.DeadboltPlugin
10005:service.PaUserServicePlugin
10040:providers.PaUsernamePasswordAuthProvider

Also don't forget to set proper SMTP credentials in conf/play-authenticate/smtp.conf to make sure that password recovering will work.

Upvotes: 9

Related Questions