コード例 #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.')
コード例 #2
0
ファイル: views.py プロジェクト: Shoobx/duo_python
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.')
コード例 #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>')
コード例 #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">')
コード例 #5
0
ファイル: views.py プロジェクト: duosecurity/duo_python
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>'
    )