Skip to main content

App connecting django-two-factor-auth and django-social-auth. If user authenticates through social auth, he will be enforced to go through 2FA (if he has it enabled).

Project description

https://badge.fury.io/py/dj-2fa-social-auth.svg https://codecov.io/gh/PetrDlouhy/dj-2fa-social-auth/branch/master/graph/badge.svg

App connecting django-two-factor-auth and social-app-django. If user authenticates through social auth, he will be enforced to go through 2FA (if he has 2FA enabled).

Documentation

The full documentation is at https://dj-2fa-social-auth.readthedocs.io.

Quickstart

We expect, that you have already installed and configured django-two-factor-auth and social-app-django according to their documentation.

Install Django two factor auth for Django social auth:

pip install dj-2fa-social-auth

Add it to your INSTALLED_APPS:

INSTALLED_APPS = (
    ...
    "two_factor",
    "social_django",
    "social_2fa",
    ...
)

Add Django two factor auth for Django social auth’s URL patterns:

from django.urls import path


urlpatterns = [
    ...
    path("", include("social_2fa.urls")),
    ...
]

Add social_2fa to your social pipeline in settings.py:

SOCIAL_AUTH_PIPELINE = (
    ...
    "social_2fa.social_pipeline.two_factor_auth",
)

Running Tests

Does the code actually work?

source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ tox

Development commands

pip install -r requirements_dev.txt
invoke -l

History

0.1.2 (2023-03-09)

0.1.1 (2023-03-08)

  • Update testing and setup.py to support newest Django, Python and django-two-factor-auth

0.1.0 (2022-03-21)

  • First release on PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dj-two-factor-social-auth-0.1.2.tar.gz (21.6 kB view details)

Uploaded Source

File details

Details for the file dj-two-factor-social-auth-0.1.2.tar.gz.

File metadata

File hashes

Hashes for dj-two-factor-social-auth-0.1.2.tar.gz
Algorithm Hash digest
SHA256 412256f2eb64fe9a017c4f4c7602e7b59baba544c49896b1b1c74b90c0c03578
MD5 a872d13152e9cdcb086d65a35eb99ad4
BLAKE2b-256 3ad2424f65dc5d4b0475efbdedac3cbff2f0a0ffc064cd4248d81e9ce1ec3997

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page