Example #1
0
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.')
Example #2
0
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.')
Example #3
0
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>')
Example #4
0
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">')
Example #5
0
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>'
    )