def duo_private_manual(request): """ View which requires a login, and manually checks for Duo authentication. """ if not duo_auth.duo_authenticated(request): return HttpResponseRedirect('%s?next=%s' % (settings.DUO_LOGIN_URL, request.path)) return HttpResponse('Content protected by Django and Duo auth.')
def duo_private_manual(request): """ View which requires a login, and manually checks for Duo authentication. """ if not duo_auth.duo_authenticated(request): return HttpResponseRedirect( '%s?next=%s' % (settings.DUO_LOGIN_URL, request.path)) return HttpResponse('Content protected by Django and Duo auth.')
def duo_private_manual(request): """ View which requires a login, and manually checks for Duo authentication. """ if not duo_auth.duo_authenticated(request): return HttpResponseRedirect('%s?next=%s' % (settings.DUO_LOGIN_URL, request.path)) return HttpResponse( '<p>Content protected by Django and Duo auth.' '<p><a href="/accounts/logout">Log out of primary Django auth.</a>' '<p><a href="/accounts/duo_logout">Log out of secondary Duo auth.</a>')
def duo_private_manual(request): """ View which requires a login, and manually checks for Duo authentication. """ if not duo_auth.duo_authenticated(request): return HttpResponseRedirect('%s?next=%s' % (settings.DUO_LOGIN_URL, request.path)) return HttpResponse( '<form action="http://127.0.0.1:8000/private"><input type="submit" value="Dashboard" /></form>' '<form action="http://127.0.0.1:8000/accounts/duo_logout"><input type="submit" value="Exit DB Configuration" /></form>' '<img src="/static/adminMongo_searchdocuments.png">')
def duo_private_manual(request): """ View which requires a login, and manually checks for Duo authentication. """ if not duo_auth.duo_authenticated(request): return HttpResponseRedirect( '%s?next=%s' % (settings.DUO_LOGIN_URL, request.path)) return HttpResponse( '<p>Content protected by Django and Duo auth.' '<p><a href="/accounts/logout">Log out of primary Django auth.</a>' '<p><a href="/accounts/duo_logout">Log out of secondary Duo auth.</a>' )