I blogged in the past about Play and JAAS. I have actually created a Play module in GitHub (https://github.com/cduicu/play-jaas) that can do JAAS style authentication in a Play application. Recently I have updated the module for Play 2.1 as well as fixing one important multi-threaded bug.
You see, I was lazy and I was passing the Http.Context via a static in order to have access to it in the callback and the login module. But this is wrong as it makes the login module thread unsafe! This was fix in the last commit and the context is now passed via callback handler to callback and then to auth module.
Thursday, March 14, 2013
Thursday, February 7, 2013
Play 2.0.x Module
During development one always finds themselves in the position of creating reusable code. For Play, I have a project containing a lot of the boilerplate code that I want to share among many concrete Play applications. One solution is to create a regular Play project (I'll refer to it as "playcommons") and set-up project dependency between your application and the playcommons project. See here for more details. However, managing the versions of the playcommons is not straight-forward.
Another solution is to make the playcommons project a Play module. This way, the project can be compiled and published and therefore the versions will be managed via the repository. I did not find some clear documentation on Play website on creating modules but here is a good article on the subject: http://www.objectify.be/wordpress/?p=363.
In the end, you can either get the packaged jar of the module and include it in the Play application (this way you don't have to manage a repository) or publish the module in a repository and then manage the dependency via Ivy in Build.scala.
Another solution is to make the playcommons project a Play module. This way, the project can be compiled and published and therefore the versions will be managed via the repository. I did not find some clear documentation on Play website on creating modules but here is a good article on the subject: http://www.objectify.be/wordpress/?p=363.
In the end, you can either get the packaged jar of the module and include it in the Play application (this way you don't have to manage a repository) or publish the module in a repository and then manage the dependency via Ivy in Build.scala.
Subscribe to:
Posts (Atom)