This project is the simple most possible implementation of Authentication
in Play Framework 2.6
using Deadbolt2
and SQLite
.
You can easily change database source to any of your choice by modifying conf/application.conf
file.
This project has the following features implemented:
- Login
- Sign Up
- Forget Password / Reset Password
- Logging (Minimal, just to get you started.)
- Email Service (Email Verification)
- Restricted Action / View
First, we need to create a database
$ cd project-directory/
$ touch users.sqlite
- Move into project directory
$ cd play-authentication-starter
- Run through script
$ ./scripts/run
- Go to http://localhost:2020/
-
By default, the project is using
mock
mail service with output to console, if you want to test with proper email do the following.-
Open
play-authentication-starter/conf/application.conf
-
In section
play.mailer { host = smtp.gmail.com port = 465 ssl = true user = "" # enter email like "[email protected]" password = "" # enter password from = "" # enter email like "[email protected]" mock = true }
Change blank
user
,from
andpassword
values to actualuser
,from
andpassword
values.If you are using gmail, you will have to change a security setting to
Allow Unsecure Apps to Access
to be able to use it. -