Flexible authentication for web, mobile, desktop and hybrid apps. It can be used for 1fa, 2fa and mfa cases.
Project description
Django Multifactor Authentication
NB. Alpha version. Deep refactoring will be completed soon.
Flexible authentication for web, mobile, desktop and hybrid apps. It can be used for 1fa, 2fa and mfa cases. Easily configurable and extendable with new authentication methods or services. Authenticaton scenarios, called flows
, based on the next identifiers
and secrets
, which can be used or not used in multiple combinations:
- username, email, phone, ...
- password, passcode (one-time pass or token), hardcode (device or card id), ...
and service providers:
- Twilio
- SendGrid (to be specified)
- Nexmo (to be done)
- Amazon SNS (to be done)
- ...add yours
Usage
The package creates custom user model, that could be used as is or as inherited. General priniciples for custom user models in Django are respected (how it works).
Base settings (required):
AUTH_USER_MODEL = 'multauth.User'
AUTHENTICATION_BACKENDS = (
'multauth.backends.ModelBackend',
# ...other backends
)
MULTAUTH_DEBUG = True # False by default
MULTAUTH_PASSCODE_LENGTH = 6 # size in digits
MULTAUTH_PASSCODE_EXPIRY = 3600 * 24 * 3 # time in seconds
MULTAUTH_FLOWS = (
('phone', 'hardcode', 'passcode',),
('email', 'password', 'passcode',),
('username', 'password',),
)
Extra settings (optional):
(see built-in devices, providers and templates)
MULTAUTH_DEVICES = [
UsernameDevice,
EmailDevice,
PhoneDevice,
] # by default
MULTAUTH_DEVICE_EMAIL_PROVIDER = 'mail' # by default
MULTAUTH_DEVICE_PHONE_PROVIDER = 'twilio' # by default
MULTAUTH_DEVICE_EMAIL_TEMPLATE_NAME = 'custom'
MULTAUTH_DEVICE_EMAIL_VERIFICATION_VIEWNAME = 'custom'
MULTAUTH_DEVICE_PHONE_TEMPLATE_NAME = 'custom'
Provider specific settings (could be required):
MULTAUTH_PROVIDER_TWILIO_ACCOUNT_SID = 'SID'
MULTAUTH_PROVIDER_TWILIO_AUTH_TOKEN = 'TOKEN'
MULTAUTH_PROVIDER_TWILIO_CALLER_ID = 'CALLER_ID'
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for django-multifactor-authentication-0.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5efbd7a8b0992a2660b331648e3284634938f1e0a58a59e45434b5997d748de6 |
|
MD5 | 5efb5e0e35b203cc7260ba5751e3b181 |
|
BLAKE2b-256 | 4ce51febc3c9ffaf6ea9b7b06a35f9f5dffe64eae76bc518ec9616b3657bcd69 |
Hashes for django_multifactor_authentication-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fdb994e151aec5da500c5bc6dc00ebe2a098a511474f3c159cb42db970fd6cd0 |
|
MD5 | c490edc83468303240e9b0872fb9d628 |
|
BLAKE2b-256 | 60b28a0b9b65c0dd17331c63bf458a6d51d85408d7514dede4cfdaa025f31b53 |