Code Monkey home page Code Monkey logo

deux's Introduction

https://deux.readthedocs.io/en/latest/_images/deux_banner.png

Build status Code Coverage BSD License Deux can be installed via wheel Supported Python versions. Support Python implementations.

Version:1.2.0
Web:https://deux.readthedocs.org/
Download:https://pypi.python.org/pypi/deux
Source:https://github.com/robinhood/deux
Keywords:authentication, two-factor, multifactor

About

Multifactor Authentication provides multifactor authentication integration for the Django Rest Framework. It integrates with Token Authentication built into DRF and OAuth2 provided by django-oauth-toolkit.

What is Multifactor Authentication?

Multifactor Authentication (MFA) is a security system that requires more than one method of authentication from independent categories of credentials to verify the user's identity for a login or other transaction. (Source: SearchSecurity)

Installation

You can install deux either via the Python Package Index (PyPI) or from source.

Requirements

deux version 1.2.0 runs on Python (2.7, 3.4, 3.5).

Installing with pip

To install using pip:

$ pip install -U deux

Downloading and installing from source

Download the latest version of deux from http://pypi.python.org/pypi/deux

You can install it by doing the following:

$ tar xvfz deux-0.0.0.tar.gz
$ cd deux-0.0.0
$ python setup.py build
# python setup.py install

The last command must be executed as a privileged user if you are not currently using a virtualenv.

Using the development version

With pip

You can install it by doing the following:

$ pip install https://github.com/robinhood/deux/zipball/master#egg=deux

deux's People

Contributors

abhishek776 avatar jakeaustwick avatar jamshedvesuna avatar mburst 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

deux's Issues

Update to use Twilio 6.x SDK

Looks like a couple of imports are causing issues for users using Twilio's Python Helper Library 6.x.

from deux/notifications.py

from __future__ import absolute_import, unicode_literals

from twilio.rest import TwilioRestClient
from twilio.rest.exceptions import TwilioRestException

these 2 imports have been moved to other modules or renamed.

Phone validator does not allow a "+" prefix

With the Twillio SMS challenge, foreign numbers (only non-US numbers with the + prefix) do not work with twillio without a "+" prefix. The duex validator throws an validation error if the "+" is in the phone number string. Specifically, I was unable to enable mfa for a uk/french number what twillio required +44 or +33 for the sms/request register endpoint.

Consider changing phone_number_validator to support international numbers. Using a library like https://github.com/daviddrysdale/python-phonenumbers my be a more holistic approach.

validators.py Regex can look like this
phone_number_validator = RegexValidator( regex=r"^(\+?\d{7,15})$", message=strings.INVALID_PHONE_NUMBER_ERROR )

Update for Python 3.7

I am building a Django backend and would love to incorporate this module. After I added it to my settings, I tried running the migration and got a syntax error:

TypeError: init() missing 1 required positional argument: 'on_delete'

From abstract models line 31:

File "/Users/duncancockfoster/Desktop/nftg_django_backend/env/lib/python3.7/site-packages/deux/abstract_models.py", line 31

I noticed that it is only supported up through Python 3.5 - will support be added for Python 3.7? Pretty sure that is the issue here.

Google Authenticator

Has anybody implemented a Google Authenticator backend for Deux? Seems like it would be common, so wondering if somebody has a starting point rather than me having to start from scratch.

Thanks,
Jake

Django 2 error: Specifying a namespace in include() without providing an app_name

When using this library with Django 2 like:

from django.urls import include, path

urlpatterns = [
    # ...
    path('mfa/', include("deux.urls", namespace="mfa")),
]

Fails with:

Specifying a namespace in include() without providing an app_name '
django.core.exceptions.ImproperlyConfigured: Specifying a namespace in include() without providing an app_name is not supported. Set the app_name attribute in the included module, or pass a 2-tuple containing the list of patterns and app_name instead.

To make this work we need to add the variable app_name to

deux/urls.py
deux/oauth2/urls.py
deux/authtoken/urls.py

Custom User model is not working

i have custom user model (AUTH_USER_MODEL = 'user.User') when i try to run migration it will generate this error

ERRORS:
deux.MultiFactorAuth.user: (fields.E301) Field defines a relation with the model 'auth.User', which has been swapped out.
HINT: Update the relation to point at 'settings.AUTH_USER_MODEL'.

Still Maintained?

Is this project still maintained? Looks like the last commit was a while ago

No Support for Custom User Model

I have custom user model and when i hit
./manage.py migrate.

It gives me following error.

deux.MultiFactorAuth.user: (fields.E301) Field defines a relation with the model 'auth.User', which has been swapped out. HINT: Update the relation to point at 'settings.AUTH_USER_MODEL

I am assuming that this library doesn't support custom user model yet. Any idea how to do it.

All pull requests fail tests

In requirements/django.txt the requirement is django. This makes all tests fail because of all the broken changes in django 2.0, which gets installed as the most current stable django version. This project either needs to merge in a pull request for django 2 support or specify it only works for django <= 1.1.x for now.

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.