User management with Play! Framework 2.0.3

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

+6
source share
1 answer

Nothing is ready yet, however I suggest you use play-authenticate ( live demo ) as a base.

This is currently the most advanced Playback 2 solution for authentication and authorization. It combines deadbolt-2 for authorization (roles and permissions) + its own authentication, which makes it a very convenient stack to start with.

Although its basic idea provides a way to authenticate users with OAuth - providers are custom settings, so you can disable them and rely only on the email provider.

Please note that this is important for you ... does not have built-in user management, however I can make sure that in the current state I need to add several actions to create what you need. I am doing this in several of my projects and will soon send a transfer request with these changes.

Edit: By default, all providers are enabled with dummy credentials, of course, they will not work. You need to disable them in conf/play.plugins (just by deleting unnecessary lines), most likely you only need to save these lines in order to save deadbolt + PA with mail:

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

Also remember to set the correct SMTP credentials in conf/play-authenticate/smtp.conf to make sure password recovery will work.

+9
source

Source: https://habr.com/ru/post/924325/


All Articles