An example for RESTful authentication using nginx, uWSGI, Flask, MongoDB, Postfix and JSON Web Token(JWT).
- Clone the repository with the following command.
git clone https://github.com/oliverSI/flask-restful-authentication.git
- Save your SSL certificates .key and .crt in ./flask-restful-authentication/certs
- Run containers with the following command.
sudo docker-compose up -d
curl -X POST -H "Content-Type: application/json" -d '{"email": "[email protected]", "password": "password"}' http://127.0.0.1/v1/register
curl -X PUT -H "Content-Type: application/json" -d '{"activation_code": "activation code you received"}’ http://127.0.0.1/v1/activate
curl -X GET -H "Content-Type: application/json" -d '{"email": “[email protected]", "password": "password"}’ http://127.0.0.1/v1/login
curl -H "Authorization: Bearer [token you got]" -H "Content-Type: application/json" http://127.0.0.1/v1/todo