Skip to content
This repository has been archived by the owner on Feb 10, 2021. It is now read-only.

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

Open
bravegag opened this issue Nov 27, 2016 · 7 comments
Open

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

bravegag opened this issue Nov 27, 2016 · 7 comments

Comments

@bravegag
Copy link
Contributor

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 bravegag changed the title Pure scala version of the sample play-authenticate-usage? Pure Scala version of the sample play-authenticate-usage? Nov 27, 2016
@bravegag
Copy link
Contributor Author

bravegag commented Nov 27, 2016

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
Copy link
Contributor Author

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
Copy link
Contributor Author

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

@bravegag
Copy link
Contributor Author

bravegag commented Dec 25, 2016

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

@bravegag
Copy link
Contributor Author

bravegag commented Dec 26, 2016

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
Copy link
Contributor Author

bravegag commented Jan 4, 2017

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
Copy link
Contributor Author

bravegag commented Jul 29, 2017

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant