Giter VIP home page Giter VIP logo

django-secure-auth's Introduction

Django-Secure-Auth

Code Health Codacy Python 2.7, 3.4+ Current version on PyPi Downloads from PyPi License

Module which provide secure authentication by TOTP/SMS/Codes/Question. Login protected by IP ranges and with captcha, when login attempt will fail.

Demo installation:

$ sudo apt-get install -y virtualenvwrapper redis-server git python-dev || brew install pyenv-virtualenvwrapper redis git geoip
$ source /usr/share/virtualenvwrapper/virtualenvwrapper.sh || source /usr/local/bin/virtualenvwrapper.sh
$ mkvirtualenv django-secure-auth
$ workon django-secure-auth
$ git clone --depth 1 https://github.com/gotlium/django-secure-auth.git
$ cd django-secure-auth
$ pip install -r requirements.txt
$ python setup.py develop
$ cd demo
$ pip install -r requirements.txt
$ python manage.py syncdb --noinput
$ python manage.py migrate --noinput
$ python manage.py createsuperuser --username admin --email [email protected]
$ wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
$ gunzip GeoLiteCity.dat.gz
$ mkdir -p /usr/share/geoip/; mv GeoLiteCity.dat /usr/share/geoip/
$ cd ../

Open settings:

$ vim demo/settings.py

Replace Twilio credentials in AUTH_SMS_BACKEND_AUTH to your demo account settings or change SMS_FORCE to False.

Run Redis server and Celery daemon(or remove 'djcelery' from INSTALLED_APPS):

$ make run_redis
$ make run_celery

Run test server:

$ make run_server

Now you can open https://127.0.0.1:8000/accounts/register/ and register new account and setup all available authentication methods.

Note: activation link will be output to console.

Crontab

When you are using TOTP auth method, please update your server time. If your server time is behind from real time, user cannot be authenticated by authenticator app. You can run ntpd clients, or update time on server by cron job:

SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
MAILTO=root@localhost

# Update time
0 */6 * * * ntpdate ntp.ubuntu.com >& /dev/null

Screenshots

/screenshots/login-confirmation.jpg

/screenshots/settings.jpg

/screenshots/two-factor-configuration.jpg

/screenshots/sms-settings.jpg

Compatibility

  • Python: 2.7
  • Django: 1.4, 1.8

django-secure-auth's People

Contributors

disillusions avatar gotlium avatar ilstreltsov avatar tapo4ek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

django-secure-auth's Issues

Update Code

This code has not been updated for a while. Please make it work with django 3 and make it more modern.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.