All Projects → adamzareba → play-silhouette-rest-mongo

adamzareba / play-silhouette-rest-mongo

Licence: other
Seed project for Play Framework 2.6 with Silhouette 5.0, exposing a REST API for sign-up and signin. ReactiveMongo + MongoDB used as a backing store.

Programming Languages

scala
5932 projects
CSS
56736 projects
HTML
75241 projects
shell
77523 projects

Projects that are alternatives of or similar to play-silhouette-rest-mongo

play-silhouette-reactivemongo-seed
Seed Application for PlayFramework, Silhouette and ReactiveMongo
Stars: ✭ 22 (+15.79%)
Mutual labels:  play-framework, silhouette, reactivemongo
Scala Play React Seed
❄️ Java Play 2.7.x + React seed project with full-fledged build process
Stars: ✭ 180 (+847.37%)
Mutual labels:  play-framework
Spark Submit Ui
This is a based on playframwork for submit spark app
Stars: ✭ 53 (+178.95%)
Mutual labels:  play-framework
Play Guard
Play2 module for rate limiting, based on token bucket algorithm
Stars: ✭ 123 (+547.37%)
Mutual labels:  play-framework
Crypto Coin Alerts
An application that let you set alerts for the prices of several cryptocurrencies
Stars: ✭ 72 (+278.95%)
Mutual labels:  play-framework
Play2 Crud
Simple CRUD & DAO implementation for play2
Stars: ✭ 146 (+668.42%)
Mutual labels:  play-framework
Pujangga
Pujangga - Indonesian Natural Language Processing Tool with REST API, an Interface for InaNLP and Deeplearning4j's Word2Vec
Stars: ✭ 47 (+147.37%)
Mutual labels:  play-framework
Play Mailer
Play mailer plugin
Stars: ✭ 243 (+1178.95%)
Mutual labels:  play-framework
Play Json Derived Codecs
Stars: ✭ 179 (+842.11%)
Mutual labels:  play-framework
Kebs
Scala library to eliminate boilerplate
Stars: ✭ 113 (+494.74%)
Mutual labels:  play-framework
Play Pdf
A PDF module for the Play framework
Stars: ✭ 108 (+468.42%)
Mutual labels:  play-framework
Lila
♞ lichess.org: the forever free, adless and open source chess server ♞
Stars: ✭ 10,315 (+54189.47%)
Mutual labels:  play-framework
Play Redis
Play framework 2 cache plugin as an adapter to redis-server
Stars: ✭ 152 (+700%)
Mutual labels:  play-framework
Vos backend
vangav open source - backend; a backend generator (generates more than 90% of the code needed for big scale backend services)
Stars: ✭ 71 (+273.68%)
Mutual labels:  play-framework
Validation
validation api extracted from play
Stars: ✭ 194 (+921.05%)
Mutual labels:  play-framework
Play Spark Scala
Stars: ✭ 51 (+168.42%)
Mutual labels:  play-framework
Play2 Html5tags
HTML5 form tags module for Play Framework
Stars: ✭ 101 (+431.58%)
Mutual labels:  play-framework
Api First Hand
API-First bootstrapping tool for building RESTful web services from a Swagger/OpenAPI spec
Stars: ✭ 138 (+626.32%)
Mutual labels:  play-framework
sbt-sass
A fork of the sbt-sass repository which seems to be abandoned.
Stars: ✭ 32 (+68.42%)
Mutual labels:  play-framework
React Play
Render React components in the Play Framework with JDK8's JavaScript engine
Stars: ✭ 216 (+1036.84%)
Mutual labels:  play-framework

Silhouette REST MongoDB Seed Build Status Codacy Badge

Example project for Play Framework that uses Silhouette for authentication and authorization, exposed REST API for sign-up, sign-in.

Basic usage

Sign-up

curl -X POST http://localhost:9000/api/auth/signup  -H 'Content-Type: application/json' -d '{"identifier": "adam.zareba", "password": "this!Password!Is!Very!Very!Strong!", "email": "[email protected]", "firstName": "Adam", "lastName": "Zaręba"}' -v
< HTTP/1.1 200 OK
< Content-Type: application/json; charset=utf-8
< X-Auth-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...

{
  "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
  "expiresOn": "2017-10-06T07:49:27.238+02:00"
}

Sign-in

Not necessary just after the sign-up because you already have a valid token.

curl -X POST http://localhost:9000/api/auth/signin/credentials -H 'Content-Type: application/json' -d '{"identifier": "adam.zareba", "password": "this!Password!Is!Very!Very!Strong!"}' -v
< HTTP/1.1 200 OK
< Content-Type: application/json; charset=utf-8
< X-Auth-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...

{
  "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
  "expiresOn": "2017-10-06T07:49:27.238+02:00"
}

Secured Action with autorization

The token must belong to a user with Admin role

curl http://localhost:9000/badPassword -H 'X-Auth-Token:eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...' -v
< HTTP/1.1 200 OK
< Content-Type: application/json; charset=utf-8

{"result":"qwerty1234"}

Built-in users

username password
test1 test1Password
test2 test2Password

Database reload

It is possible to reload database with based data with scripts: recreate.bat or recreate.sh

API documentation

Documentation is available under address: REST API

License

The code is licensed under Apache License v2.0.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].