Questions tagged [django-two-factor-auth]

28 questions
5
votes
3 answers

django-two-factor-auth can't access admin site

I am using django-two-factor-auth for a webapp. I cannot access the admin page. I know I am entering the correct credentials. When I input incorrect credentials, I get an appropriate error message. When I input the correct credentials, the page…
2
votes
1 answer

Calling a third party package's management command from a Django view

I am currently using the package 'django-two-factor-authentication' in my Django project and I see the management commands here (https://django-two-factor-auth.readthedocs.io/en/1.14.0/management-commands.html) My client would like to have a…
Jake Mulhern
  • 660
  • 5
  • 13
2
votes
1 answer

How do I fully authenticate a test user in my test cases with django-two-factor-auth to access OTPRequiredMixin views?

I'm trying to write test cases for my class views that are secure behind django-two-factor-auth OTPRequiredMixin. I'm not sure how to write the setUp function to fully authenticate the user through OTP. I've tried self.client.force_login() but when…
1
vote
1 answer

django-two-factor-auth[phonenumbers] got a redundant migration -> psycopg2.errors.DuplicateTable: relation "two_factor_phonedevice" already exists

I'm facing the following database creation table error when spinning up a django project from scratch when I have django-two-factor-auth[phonenumbers] in my requirements. When I run the migrate command, it raises a psycopg2.errors.DuplicateTable…
swiss_knight
  • 5,787
  • 8
  • 50
  • 92
1
vote
1 answer

no such table: two_factor_phonedevice when using django-two-factor-auth==1.14.0 and --nomigrations

I have a 2.2 Django project with django-otp==0.8.0, django-two-factor-auth[phonenumbers]==1.14.0, and an app two_factor_auth that makes use of these two libraries. When tests are run with migrations, they pass: $ ./manage.py test two_factor_auth …
1
vote
0 answers

django-two-factor-auth's user.is_verified() returns False on subdomains

I am facing this strange issue, I have posted it here already but didn't get any response yet. I am using django-two-factor-auth in my Django application, Everything works fine in the local environment but getting an issue on the production…
1
vote
1 answer

Django Rest Framework and django rest framework simplejwt two factor authentication

I am using django version 3.2.4 in combination with Django Rest Framework. I also use https://github.com/jazzband/djangorestframework-simplejwt for JWTs. Problem: I need to enable Two Factor Authentication in the following way. User uses an…
1
vote
1 answer

Django 2FA works locally but fails (silently) on server

The Problem I need to implement two-factor authentication for a Django project. I am using Django Two-Factor Authentication which works just fine locally both with Google Authenticator and our SMS gateway. The issue occurs when I publish the app to…
niknoe
  • 323
  • 5
  • 14
1
vote
0 answers

How to include Duo Authentication to Django UI after Windows Authentication

i have a code which performs uploading of file to certain destination, and i have already include windows authentication as first phase of authentication and wanted to include Duo Security as second authentication. So i referred few of the git and…
1
vote
1 answer

Django Two Factor Authentication not working

I am trying to do the two-factor authentication set up for my Django project. Below is the configuration details settings.py 'django_otp', 'django_otp.plugins.otp_static', 'django_otp.plugins.otp_totp', 'two_factor', ... …
0
votes
1 answer

How to override the templates of `django-two-factor-auth` for Django Admin?

I'm trying to override the templates of django-two-factor-auth for Django Admin but I don't know how to do it. *I don't have frontend with Django. Instead, I have frontend with Next.js and backend with Django. This is my django…
0
votes
0 answers

Djagno - custom User model with two factor auth - invalid credentials leads to creating a new user in database, valid credentials work, 2FA also

I have a django project, where i have custom user model stated as below : class CustomUserModel(AbstractUser): # MAKING email field mandatory email = models.EmailField(unique=True) # KEEP TRACK OF USER'S PASSWORD CREATION DATE TO ENFORCE…
0
votes
1 answer

Is saving the user object to sessions safe to do when logging them in?

I am writing my own 2FA functionality (I know that django-otp and django-two-factor-auth exist, this is just for fun). Everything is fine except for the log in view. I know that you can use the following to authenticate the user: user =…
0
votes
2 answers

Django Two Factor Auth combined with Rest Framework?

I'm trying to implement django two factor auth into my Rest API. Is there a possibility to implement this by using custom views and model creations? Because, at least that's the way I understood it, this library is mainly working based on default…
0
votes
1 answer

Django django-two-factor-auth Error 'two_factor_tags' is not a registered tag library

I needed 2FA for my Staff members so I installed django-two-factor-auth But there seems to be an issue with the 'two_factor_tags' in core/login.html file Error message : 'two_factor_tags' is not a registered tag library . Must be one…
1
2