Skip to content

ankurayadav/flask_arangodb_auth

Repository files navigation

flask_arangodb_auth

This project contains auth code for flask using arangodb as backend.

This project contains two branches:

  1. simple_auth: Contains simple auth framework for username and password based login using flask-restfull and arangodb as the backend.
  2. master; This contains token based auth using flask-restful and arangodb as the backend.

###Setup Steps

  1. Make a database of your in arangodb and put it in settings.py as:

ARANGODB_DATABASE="mydatabase"
  1. Run the migration for making users collection:

$> python migrate_collections.py
  1. Run server to test it.

$> python url.py
  1. Open a new terminal.
  2. Create a user.

$> curl -i -X POST -H "Content-Type: application/json" -d '{"username":"user","password":"pass"}' http://127.0.0.1:5000/api/users
  1. Try to get access token for that user.

$> curl -u user:pass -i -X GET http://127.0.0.1:5000/api/token
  1. Now you will get an auth token. You can use that auth token to access other resources like:

$> curl -u your-auth-token:unused -i -X GET http://127.0.0.1:5000/
  1. You should get hello world in response.

About

This project contains auth code for flask using arangodb as backend.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages