play-authenticate icon indicating copy to clipboard operation
play-authenticate copied to clipboard

Pure Scala version of the sample play-authenticate-usage?

Open bravegag opened this issue 7 years ago • 7 comments

Is anyone else really wanting to have a Scala version of the play-authenticate-usage? is there some fork/work in progress? I am trying to migrate the play-authenticate-usage example to Scala, have bumped into several issues and need a hand or two :)

My stack is: Scala, Play-slick and Postgres (using Slick code gen). I'm more db-driven in my projects and the performance payoffs of using Slick over JPA seem to be substantial.

bravegag avatar Nov 27 '16 21:11 bravegag

I prepared a baby-steps migration to Scala of the play-authenticate-usage sample here: https://github.com/bravegag/play-authenticate-usage-scala. My approach is to migrate the usage sample bringing up bit by bit and keep the project overall compiling and running. As of now it compiles and runs up to the evolutions step, then a runtime exception is thrown coming from Deadbolt2.

The project uses the latest version of all dependencies. The play-authenticate unreleased dependency is built locally.

I prepared a postgres 1.sql that is installed in the database using evolutions. Later, the ./test/Generator.scala may be executed to get the generated Tables.scala under ./app/generated. There is a basic ./app/dao/UserDao.scala implementation. I'm planning to do a generic Dao for Slick using that UserDao as base.

Another thing, Deadbolt2 needs some of the Model classes implementing some traits e.g. User to implement Subject. This I plan to do by customizing the Slick code generator.

Help is most welcome!

bravegag avatar Nov 27 '16 22:11 bravegag

Status: a handful of compiler errors away from migration.

Done => All controllers, forms, and view have been migrated to Scala, peer-reviews anyone?

Pending => so far left providers package in Java but will migrate ... issue: Scala Forms and Java Form type mismatch needed for the Login and Signup forms needed by the PA framework. Need some design improvements on the Dao/Services side

bravegag avatar Dec 14 '16 21:12 bravegag

Status: first time it all runs, now get exceptions while accessing some pages ... help most welcome :)

bravegag avatar Dec 19 '16 22:12 bravegag

Migration completed, now testing ... can signup, login and verify email address already!

bravegag avatar Dec 25 '16 18:12 bravegag

Added support for Google reCAPTCHA via the (really nice) plugin https://github.com/chrisnappin/play-recaptcha. This plugin integrates super nicely with the standard Play Form infrastructure. Now the Scala usage implementation uses Google reCAPTCHA in the Signup Form

recaptcha

bravegag avatar Dec 26 '16 21:12 bravegag

btw the migration took me a month but is now complete. I had to do a small workaround in-lining the AbstractUsernamePasswordAuthProvider.java implementation (see PR #324). But once the PR #324 is merged it can be removed.

I have completed 100% test coverage of the Slick base DAO layer.

bravegag avatar Jan 04 '17 18:01 bravegag

I migrated the https://github.com/bravegag/play-authenticate-usage-scala project to PA version 0.8.3 including the changes following from PR #324

bravegag avatar Jul 29 '17 07:07 bravegag