Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 365
nicowernli Avatar asked Sep 01 '12 03:09

nicowernli


People also ask

Is it possible to enable authentication on Play Framework?

Despite most frameworks do have plugins for authentication (for instance Spring Session ), Play doesn’t offer anything like that. But to be fair, Play makes it very easy to implement. I found a few open source solutions to handle authentication on Play Framework:

What permissions are required to publish apps on Google Play?

This permission does not allow users to publish apps on Google Play. To create new apps, users also need to have the View app information and download bulk reports (read-only) permission. This permission is available for users with “Account” access only.

How do I manage play console permissions in Google payments center?

Play Console permissions are separate from any permissions managed within the Google payments center. Sign in to the Google payments center. On the left menu, select Settings . Under "Payments users," select Manage Payments Users > Add a new user.

What is the “account” permission in Google Play?

The “Account” equivalent is Create, edit, and delete draft apps. This permission does not allow users to publish apps on Google Play. To create new apps, users also need to have the View app information and download bulk reports (read-only) permission.


Video Answer


1 Answers

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.

like image 89
biesior Avatar answered Oct 03 '22 23:10

biesior