How to include Duo Authentication to Django UI after Windows Authentication

236 Views Asked by At

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 other platforms regarding duo security and edited my settings.py and Urls.py as below

Settings.py

INSTALLED_APPS = [
    'duo_auth',
]
MIDDLEWARE = [
    # ...
    'duo_auth.middleware.DuoAuthMiddleware',
]
DUO_CONFIG = {
    'DEFAULT': {
        'HOST': '<api-host-url>',
        'IKEY': '<integration_key>',
        'AKEY': '<app_secret_key>',
        'SKEY': '<secret_key>',
        'FIRST_STAGE_BACKENDS': [
            'django.contrib.auth.backends.ModelBackend',
        ]
    }
}

and URLS.py as

urlpatterns = [
    path('admin/', admin.site.urls),
    path('duo/',  include('duo_auth.urls')),
    path('', views.home,name='home'),
    path('create', views.create,name='create'),
    path('files', views.files,name='files'),
]+static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)

and installed django-duo-auth and is successfully installed, i migrated the change and ran server, restarted app. But this is throwing me error 500.

So i really don know whether any change other than this is required or anything is to be added or removed. i didn't find any relative paper or article which i can read and solve this issue.

So this is the error obtained Error

It says "THERE IS A PROBLEM WITH RESOURCE YOU ARE LOOKING FOR AND CANNOT BE DISPLAYED "

0

There are 0 best solutions below