View on GitHub

play-example-login

A simple example of authentication and authorization in Play

Download this project as a .zip file Download this project as a tar.gz file

screenshot

Overview

This is a Play application illustrating a simple approach to authentication and authorization.

Authentication is done in the following way:

Authorization is done in the following way:

Obvious shortcomings of this approach:

If you require "production quality" authentication and authorization, you should consider a Play plugin such as play-authenticate, SecureSocial, and/or Deadbolt 2. They are slightly more complicated to use but provide mechanisms to address these issues.

Screencast

Click the image below to watch a 15 minute walkthrough of this system.