All Projects → CuriousLearner → Django Phone Verify

CuriousLearner / Django Phone Verify

Licence: gpl-3.0
A Django app to support phone number verification using security code / One-Time-Password (OTP) sent via SMS.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Django Phone Verify

Phpid Learning
🙋 Belajar daring bersama PHPID
Stars: ✭ 125 (+3.31%)
Mutual labels:  hacktoberfest
Scrutor
Assembly scanning and decoration extensions for Microsoft.Extensions.DependencyInjection
Stars: ✭ 1,915 (+1482.64%)
Mutual labels:  hacktoberfest
Wagtail
A Django content management system focused on flexibility and user experience
Stars: ✭ 11,387 (+9310.74%)
Mutual labels:  hacktoberfest
Python Resources 2019
A curated list of Python 3 resources, books, websites, tutorials, code challenges
Stars: ✭ 125 (+3.31%)
Mutual labels:  hacktoberfest
Docker Lvm Plugin
Docker volume plugin for LVM volumes
Stars: ✭ 125 (+3.31%)
Mutual labels:  hacktoberfest
Storefront Ui
Customization-first, performance-oriented and elegant UI framework for eCommerce (and not only) based on Vue.js and Google Retail UX Playbook. Made with 💚 by Vue Storefront team and contributors.
Stars: ✭ 1,827 (+1409.92%)
Mutual labels:  hacktoberfest
Hickory
🕰 The command line tool for scheduling Python scripts
Stars: ✭ 126 (+4.13%)
Mutual labels:  hacktoberfest
Hydra
OpenID Certified™ OpenID Connect and OAuth Provider written in Go - cloud native, security-first, open source API security for your infrastructure. SDKs for any language. Compatible with MITREid.
Stars: ✭ 11,884 (+9721.49%)
Mutual labels:  hacktoberfest
Node Oidc Provider
OpenID Certified™ OAuth 2.0 Authorization Server implementation for Node.js
Stars: ✭ 2,018 (+1567.77%)
Mutual labels:  hacktoberfest
Discord.js
discord.js is a powerful Node.js module that allows you to easily interact with the Discord API.
Stars: ✭ 16,432 (+13480.17%)
Mutual labels:  hacktoberfest
Pandaset Devkit
Stars: ✭ 121 (+0%)
Mutual labels:  hacktoberfest
Industrial Foregoing
IF: you need to automate all the things
Stars: ✭ 125 (+3.31%)
Mutual labels:  hacktoberfest
Litmus
Litmus helps SREs and developers practice chaos engineering in a Cloud-native way. Chaos experiments are published at the ChaosHub (https://hub.litmuschaos.io). Community notes is at https://hackmd.io/a4Zu_sH4TZGeih-xCimi3Q
Stars: ✭ 2,377 (+1864.46%)
Mutual labels:  hacktoberfest
Poke95
🚀 A Windows 95 style Pokédex built with React.
Stars: ✭ 124 (+2.48%)
Mutual labels:  hacktoberfest
Cphalcon
High performance, full-stack PHP framework delivered as a C extension.
Stars: ✭ 10,534 (+8605.79%)
Mutual labels:  hacktoberfest
Foundryvtt Docker
An easy-to-deploy Dockerized Foundry Virtual Tabletop server.
Stars: ✭ 123 (+1.65%)
Mutual labels:  hacktoberfest
Mythril
Security analysis tool for EVM bytecode. Supports smart contracts built for Ethereum, Hedera, Quorum, Vechain, Roostock, Tron and other EVM-compatible blockchains.
Stars: ✭ 1,968 (+1526.45%)
Mutual labels:  hacktoberfest
Materialdesigninxamltoolkit
Google's Material Design in XAML & WPF, for C# & VB.Net.
Stars: ✭ 11,603 (+9489.26%)
Mutual labels:  hacktoberfest
Http Server
a simple zero-configuration command-line http server
Stars: ✭ 11,280 (+9222.31%)
Mutual labels:  hacktoberfest
Voyager
Voyager - The Missing Laravel Admin
Stars: ✭ 10,801 (+8826.45%)
Mutual labels:  hacktoberfest

django-phone-verify

.. image:: https://travis-ci.org/CuriousLearner/django-phone-verify.svg?branch=master :target: https://travis-ci.org/CuriousLearner/django-phone-verify

.. image:: https://coveralls.io/repos/github/CuriousLearner/django-phone-verify/badge.svg?branch=master :target: https://coveralls.io/github/CuriousLearner/django-phone-verify?branch=master

.. image:: https://pypip.in/license/django-phone-verify/badge.svg :target: https://pypi.python.org/pypi/django-phone-verify/ :alt: License

.. image:: https://img.shields.io/badge/Made%20with-Python-1f425f.svg :target: https://www.python.org/

.. image:: https://img.shields.io/badge/Maintained%3F-yes-green.svg :target: https://GitHub.com/CuriousLearner/django-phone-verify/graphs/commit-activity

.. image:: https://badge.fury.io/py/django-phone-verify.svg :target: https://pypi.python.org/pypi/django-phone-verify/

.. image:: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square :target: http://makeapullrequest.com

A Django app to support phone number verification using the security code sent via SMS.

Salient Features

  • Lets you verify phone numbers via SMS.
  • Extensibility to provide tokens with varying length.
  • Comes with Twilio already integrated.
  • Set expiration time on tokens.
  • Provides an interface for writing custom SMS sending backend for easy extensibility.
  • Does not mess-up with existing AUTH_USER_MODEL at all.
  • Can be used for a number of potential use-cases, and not just auth.
  • Provides ready endpoints for sending SMS and verification (See api_endpoints.rst_).

.. _api_endpoints.rst: https://github.com/CuriousLearner/django-phone-verify/blob/master/phone_verify/docs/api_endpoints.rst

Installation

.. code-block:: shell

pip install django-phone-verify

Configuration

  • Add app to INSTALLED_APPS

.. code-block:: python

# In settings.py:

# Add app to `INSTALLED_APPS`
INSTALLED_APPS = [
    ...
    "phone_verify",
]
  • Add settings for Phone Verify as you desire:

.. code-block:: python

# In settings.py
# Add settings for phone_verify to work
PHONE_VERIFICATION = {
    "BACKEND": "phone_verify.backends.twilio.TwilioBackend",
    "OPTIONS": {
        "SID": "fake",
        "SECRET": "fake",
        "FROM": "+14755292729",
        "SANDBOX_TOKEN": "123456",
    },
    "TOKEN_LENGTH": 6,
    "MESSAGE": "Welcome to {app}! Please use security code {security_code} to proceed.",
    "APP_NAME": "Phone Verify",
    "SECURITY_CODE_EXPIRATION_TIME": 3600,  # In seconds only
    "VERIFY_SECURITY_CODE_ONLY_ONCE": False,  # If False, then a security code can be used multiple times for verification
}

Usage

  • To explore more about how to use, integrate and leverage existing functionality of Django Phone Verify, have a look at usage.rst_

.. _usage.rst: https://github.com/CuriousLearner/django-phone-verify/blob/master/docs/usage.rst

Note: Django Phone Verfiy also provides Nexmo as a backend service other than Twilio. To switch to Nexmo, replace BACKEND within your PHONE_VERIFICATION setting with phone_verify.backends.nexmo.NexmoBackend and define KEY within OPTIONS of PHONE_VERIFICATION setting, with your nexmo API key, in place of already available SID.

Compatibility

  • Django 2.1+
  • Django REST Framework 3.9+

Contributing

No code is bug-free and I'm sure this app will have bugs. If you find any bugs, please create an issue on GitHub.

Licence

GPLv3

Release Notes

[2.0.0] ^^^^^^^

NOTE: Previous version of this library provided the security_code in the JWT session_token. You would have to re-verify phone_numbers in this version to ensure they are authentically verified.

Added """""

  • Tests added to provide 100% coverage on the package.
  • Add nexmo.errors.ClientError as exception class in phone_verify.backends.nexmo.NexmoBackend & phone_verify.backends.nexmo.NexmoSandboxBackend.

Changed """""""

  • Method signature changed for phone_verify.backends.BaseBackend.generate_session_token. It now accepts only phone_number instead of combination of phone_number and security_code.
  • Remove the security_code from JWT session_token to avoid leaking information.
  • Add nonce in session_token to generate unique tokens for each phone_number.
  • Fixes call to phone_verify.backends.nexmo.NexmoBackend.send_sms method.

[1.1.0] ^^^^^^^

Added """""

  • Support Nexmo as a backend service alongwith Twilio.
  • Add docs for writing custom backend.

Changed """""""

  • Update backends.base.BaseBackend.validate_security_code to use save() instead of update() to allow Django to emit its post_save() signal.

[1.0.0] ^^^^^^^

Added """""

  • Add coverage report through coveralls.
  • Support for One-Time Passwords (OTP) using VERIFY_SECURITY_CODE_ONLY_ONCE as True in the settings.
  • Script to support makemigrations for development.
  • BaseBackend status now have SECURITY_CODE_VERIFIED and SESSION_TOKEN_INVALID status to support new states.

Changed """""""

  • Rename TWILIO_SANDBOX_TOKEN to SANDBOX_TOKEN.
  • Fix signature for send_bulk_sms method in TwilioBackend and TwilioSandboxBackend.
  • Response for /api/phone/register contains key session_token instead of session_code.
  • Request payload for /api/phone/verify now expects session_token key instead of session_code.
  • Response for /api/phone/verify now sends additional response of Security code is already verified in case VERIFY_SECURITY_CODE_ONLY_ONCE is set to True.
  • Rename otp to security_code in code and docs to be more consistent.
  • Rename BaseBackend status from VALID, INVALID, EXPIRED to SECURITY_CODE_VALID, SECURITY_CODE_INVALID, and SECURITY_CODE_EXPIRED respectively.
  • Rename session_code to session_token to be consistent in code and naming across the app.
  • Rename service send_otp_and_generate_session_code to send_security_code_and_generate_session_token.
  • Rename method BaseBackend.generate_token to BaseBackend.generate_security_code.
  • Rename method create_otp_and_session_token to create_security_code_and_session_token.
  • Rename method BaseBackend.validate_token to BaseBackend.validate_security_code with an additional parameter of session_token.

[0.2.0] ^^^^^^^

Added """""

  • pre-commit-config to maintain code quality using black and other useful tools.
  • Docs for integration and usage in usage.rst_.
  • Tox for testing on py{37}-django{20,21,22}.
  • Travis CI for testing builds.

Changed """""""

  • Convert *.md docs to reST Markup.
  • Fix issue with installing required package dependencies via install_requires.

[0.1.1] ^^^^^^^

Added """""

  • README and documentation of API endpoints.
  • setup.cfg to manage coverage.
  • phone_verify app including backends, requirements, tests.
  • Intial app setup.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].