Metadata-Version: 2.0
Name: django-secure-auth
Version: 1.3b1
Summary: Secure authentication by TOTP, SMS, Codes & Question
Home-page: https://github.com/gotlium/django-secure-auth
Author: GoTLiuM InSPiRiT
Author-email: gotlium@gmail.com
License: GPL v3
Keywords: django secure auth protection totp sms codes question
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.7
Requires-Dist: django-filter (>=0.7)
Requires-Dist: django-ipware (>=0.0.8)
Requires-Dist: django-phonenumber-field (>=0.5)
Requires-Dist: django-simple-captcha (>=0.4.2)
Requires-Dist: django-tables2 (>=0.14.0)
Requires-Dist: httpagentparser (>=1.5.0)
Requires-Dist: ipaddress (>=1.0.6)
Requires-Dist: phonenumbers (>=6.1.0)
Requires-Dist: pyotp (>=1.3.1)
Requires-Dist: slowaes (==0.1a1)

Django-Secure-Auth
==================

.. image:: https://landscape.io/github/gotlium/django-secure-auth/master/landscape.svg
   :target: https://landscape.io/github/gotlium/django-secure-auth/master
   :alt: Code Health
.. image:: https://api.codacy.com/project/badge/grade/e1788d6ac7ca437aa6bbb3abfdf19dce
    :target: https://www.codacy.com/app/gotlium/django-secure-auth
    :alt: Codacy
.. image:: https://img.shields.io/badge/python-2.7-blue.svg
    :alt: Python 2.7, 3.4+
    :target: https://pypi.python.org/pypi/django-secure-auth/
.. image:: https://img.shields.io/pypi/v/django-secure-auth.svg
    :alt: Current version on PyPi
    :target: https://pypi.python.org/pypi/django-secure-auth/
.. image:: https://img.shields.io/pypi/dm/django-secure-auth.svg
    :alt: Downloads from PyPi
    :target: https://pypi.python.org/pypi/django-secure-auth/
.. image:: https://img.shields.io/badge/license-GPLv3-green.svg
    :target: https://pypi.python.org/pypi/django-secure-auth/
    :alt: 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:
------------------

.. code-block:: bash

    $ 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 admin@local.host
    $ 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:

.. code-block:: bash

    $ 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``):

.. code-block:: bash

    $ make run_redis
    $ make run_celery


Run test server:

.. code-block:: bash

    $ 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:

.. code-block:: bash

    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
-----------
.. image:: /screenshots/login-confirmation.jpg
.. image:: /screenshots/settings.jpg
.. image:: /screenshots/two-factor-configuration.jpg
.. image:: /screenshots/sms-settings.jpg


Compatibility
-------------
* Python: 2.7
* Django: 1.4, 1.8


