Please help me with this simple Django app that uses 2FA integration with Duo

I'm a junior Python developer with less than a year's experience in Python. I've been given a task to create a login page using Django and then integrate it with Duo for 2 factor authentication. I've managed to create a simple login page with 1FA, but I'm stuck on trying to incorporate Duo into it.

Here's a link to the code which I've got - https://github.com/TheLoneWayfarer/django-duo.git

I'm quite new to this, so please let me know if you need any more info or if anything in the links is not accessible.

The expecation is that the user visits the /duo/login endopoint, provides their details, it directs them to the Duo 2FA page where they get authenticated, and then it needs to go to the home.html page.

I'm using this package for Duo - https://pypi.org/project/django-duo-universal-auth/

I've done everything in the link like add the parameters to the settings.py file and add the path into the urls.py file, but I'm getting this error when I try to log in :

{"error": "invalid_grant", "error_description": "Invalid redirect URI 'http://127.0.0.1:8000/duo/callback/'."}

I'm not sure what I'm missing, so any guidance would be much appreciated.

Back to Top