This project provides a template for any web application that requires user Authentication/Authorization. The backend is Scala Play framework. The frontend is built on AngularJS with Stormpath AngularJS. The angular ui router is used instead of ng route as it is required by the stormpath module. The Scala template is only used to load the index page as I have found angular to be a bit easier to use and has a lot more community support. The user database is hosted by Stormpath, an authentication and authorization service and implemented using their java api. The front end design is from a stormpath example project, the only modifications are to add some group functionality
The only steps you need to get it going are:
- Have scala - sbt installed
- Create a Stormpath account
Download and install here: scala - sbt
2. Create a Stormpath account
Follow instructions at Stormpath Use your api key and create a property file ~/.stormpath/apiKey.properties
apiKey.id = ###
apiKey.secret = ###
Create an application and directory using the Stormpath web client. Set those values in the application.conf file
By default after creating an account you are redirected to the login page and can immediately log in. If you want to verify the provided email address browse to the directory in the Stormpath -> Workflows & Emails -> Verification Email. Set the Link Base URL to http://localhost:9000/verifyPage.
Use sbt to run the application
sbt run
Browse to https://localhost:9000
Now you are set up to start developing. To add a secure endpoint use the class AuthenticatedAction. It mimics the Action class from the play framework. Play will auto create a self signed SSL certificate which will work fine for development but should be changed for production.